From a2d89f11d1325b956968203305dcbdd8979c987e Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Fri, 8 Apr 2022 19:42:57 +0200 Subject: [PATCH] LibWeb: Use the correct painter for painting stacking contexts When cloning the PaintContext we should be using the painter backed by the bitmap created for this stacking context layer. Fixes: 54c3053bc3b0 ("LibWeb: Preserve paint state when painting...") --- Userland/Libraries/LibWeb/Painting/PaintContext.h | 4 ++-- Userland/Libraries/LibWeb/Painting/StackingContext.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.h b/Userland/Libraries/LibWeb/Painting/PaintContext.h index 7acbcbc276..457b544ad7 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.h +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.h @@ -37,9 +37,9 @@ public: bool has_focus() const { return m_focus; } void set_has_focus(bool focus) { m_focus = focus; } - PaintContext clone() const + PaintContext clone(Gfx::Painter& painter) const { - auto clone = PaintContext(m_painter, m_palette, m_scroll_offset); + auto clone = PaintContext(painter, m_palette, m_scroll_offset); clone.m_viewport_rect = m_viewport_rect; clone.m_should_show_line_box_borders = m_should_show_line_box_borders; clone.m_focus = m_focus; diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp index 048b56a663..0b45eb855a 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp @@ -262,7 +262,7 @@ void StackingContext::paint(PaintContext& context) const return; auto bitmap = bitmap_or_error.release_value_but_fixme_should_propagate_errors(); Gfx::Painter painter(bitmap); - auto paint_context = context.clone(); + auto paint_context = context.clone(painter); paint_internal(paint_context); auto transform_origin = this->transform_origin();