mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb/WebGL: Avoid copying canvas surface when uploading it
This commit is contained in:
parent
d65f0e4490
commit
d733bf54cc
Notes:
github-actions[bot]
2025-10-25 10:57:23 +00:00
Author: https://github.com/Lubrsi
Commit: d733bf54cc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6558
1 changed files with 2 additions and 4 deletions
|
|
@ -128,10 +128,8 @@ Optional<WebGLRenderingContextBase::ConvertedTexture> WebGLRenderingContextBase:
|
|||
[](GC::Root<HTML::HTMLCanvasElement> const& source) -> RefPtr<Gfx::ImmutableBitmap> {
|
||||
auto surface = source->surface();
|
||||
if (!surface)
|
||||
return {};
|
||||
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::RGBA8888, Gfx::AlphaType::Premultiplied, surface->size()));
|
||||
surface->read_into_bitmap(*bitmap);
|
||||
return Gfx::ImmutableBitmap::create(*bitmap);
|
||||
return Gfx::ImmutableBitmap::create(*source->get_bitmap_from_surface());
|
||||
return Gfx::ImmutableBitmap::create_snapshot_from_painting_surface(*surface);
|
||||
},
|
||||
[](GC::Root<HTML::OffscreenCanvas> const& source) -> RefPtr<Gfx::ImmutableBitmap> {
|
||||
return Gfx::ImmutableBitmap::create(*source->bitmap());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue