mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
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:
parent
b23b21fa4a
commit
24527b6ae3
Notes:
github-actions[bot]
2025-04-01 21:40:08 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 24527b6ae3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4175
7 changed files with 18 additions and 19 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue