mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
|
@ -35,13 +35,20 @@ static bool command_is_clip_or_mask(Command const& command)
|
|||
});
|
||||
}
|
||||
|
||||
void DisplayListPlayer::execute(DisplayList& display_list)
|
||||
void DisplayListPlayer::execute(DisplayList& display_list, RefPtr<Gfx::PaintingSurface> surface)
|
||||
{
|
||||
if (surface)
|
||||
m_surfaces.append(*surface);
|
||||
ScopeGuard guard = [&surfaces = m_surfaces, pop_surface_from_stack = !!surface] {
|
||||
if (pop_surface_from_stack)
|
||||
(void)surfaces.take_last();
|
||||
};
|
||||
|
||||
auto const& commands = display_list.commands();
|
||||
auto const& scroll_state = display_list.scroll_state();
|
||||
auto device_pixels_per_css_pixel = display_list.device_pixels_per_css_pixel();
|
||||
|
||||
VERIFY(m_surface);
|
||||
VERIFY(!m_surfaces.is_empty());
|
||||
|
||||
for (size_t command_index = 0; command_index < commands.size(); command_index++) {
|
||||
auto scroll_frame_id = commands[command_index].scroll_frame_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue