mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Copy bitmap onto the returned canvas when taking a screenshot
This commit is contained in:
parent
b08f12d3e6
commit
d3c21e4038
|
|
@ -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 New Issue
Block a user