From d3c21e40381a769f9c99393330e091f24c8fc38e Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Wed, 13 Nov 2024 10:50:58 +0000 Subject: [PATCH] LibWeb: Copy bitmap onto the returned canvas when taking a screenshot --- Libraries/LibWeb/WebDriver/Screenshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/WebDriver/Screenshot.cpp b/Libraries/LibWeb/WebDriver/Screenshot.cpp index 9c68bda7c53..76645121888 100644 --- a/Libraries/LibWeb/WebDriver/Screenshot.cpp +++ b/Libraries/LibWeb/WebDriver/Screenshot.cpp @@ -53,9 +53,9 @@ ErrorOr, 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(), backing_store); + canvas.surface()->write_from_bitmap(*bitmap); // 7. Return success with canvas. return canvas;