mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb: Copy bitmap onto the returned canvas when taking a screenshot
This commit is contained in:
parent
b08f12d3e6
commit
d3c21e4038
Notes:
github-actions[bot]
2024-11-13 13:39:33 +00:00
Author: https://github.com/tcl3
Commit: d3c21e4038
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2309
1 changed files with 1 additions and 1 deletions
|
@ -53,9 +53,9 @@ ErrorOr<JS::NonnullGCPtr<HTML::HTMLCanvasElement>, WebDriver::Error> draw_boundi
|
||||||
Gfx::IntRect paint_rect { rect.x(), rect.y(), paint_width, paint_height };
|
Gfx::IntRect paint_rect { rect.x(), rect.y(), paint_width, paint_height };
|
||||||
|
|
||||||
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::AlphaType::Premultiplied, canvas.surface()->size()));
|
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::AlphaType::Premultiplied, canvas.surface()->size()));
|
||||||
canvas.surface()->read_into_bitmap(*bitmap);
|
|
||||||
auto backing_store = Web::Painting::BitmapBackingStore(bitmap);
|
auto backing_store = Web::Painting::BitmapBackingStore(bitmap);
|
||||||
browsing_context.page().client().paint(paint_rect.to_type<Web::DevicePixels>(), backing_store);
|
browsing_context.page().client().paint(paint_rect.to_type<Web::DevicePixels>(), backing_store);
|
||||||
|
canvas.surface()->write_from_bitmap(*bitmap);
|
||||||
|
|
||||||
// 7. Return success with canvas.
|
// 7. Return success with canvas.
|
||||||
return canvas;
|
return canvas;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue