mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb/WebGL: Avoid copying canvas surface when uploading it
This commit is contained in:
committed by
Andreas Kling
parent
d65f0e4490
commit
d733bf54cc
Notes:
github-actions[bot]
2025-10-25 10:57:23 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/d733bf54cc8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6558
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user