mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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: https://github.com/LadybirdBrowser/ladybird/commit/d3c21e40381 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 };
|
||||
|
||||
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);
|
||||
browsing_context.page().client().paint(paint_rect.to_type<Web::DevicePixels>(), backing_store);
|
||||
canvas.surface()->write_from_bitmap(*bitmap);
|
||||
|
||||
// 7. Return success with canvas.
|
||||
return canvas;
|
||||
|
|
Loading…
Reference in a new issue