LibWeb: Pass PaintingSurface into DisplayListPlayer::execute()

Deleteing set_surface() makes DisplayListPlayer API a bit more intuitive
because now caller doesn't have to think whether it's necessary to
restore previous surface after execution, instead DisplayListPlayer
takes care of it by maintaining a stack of surfaces.
This commit is contained in:
Aliaksandr Kalenik 2025-04-01 19:53:16 +02:00 committed by Alexander Kalenik
commit 24527b6ae3
Notes: github-actions[bot] 2025-04-01 21:40:08 +00:00
7 changed files with 18 additions and 19 deletions

View file

@ -972,10 +972,7 @@ void DisplayListPlayerSkia::add_mask(AddMask const& command)
auto mask_surface = Gfx::PaintingSurface::create_with_size(m_context, rect.size(), Gfx::BitmapFormat::BGRA8888, Gfx::AlphaType::Premultiplied);
NonnullRefPtr old_surface = surface();
set_surface(mask_surface);
execute(*command.display_list);
set_surface(old_surface);
execute(*command.display_list, mask_surface);
SkMatrix mask_matrix;
mask_matrix.setTranslate(rect.x(), rect.y());
@ -988,7 +985,7 @@ void DisplayListPlayerSkia::paint_nested_display_list(PaintNestedDisplayList con
{
auto& canvas = surface().canvas();
canvas.translate(command.rect.x(), command.rect.y());
execute(*command.display_list);
execute(*command.display_list, {});
}
void DisplayListPlayerSkia::paint_scrollbar(PaintScrollBar const& command)