LibGfx+LibWeb: Reuse DisplayListPlayer and PaintingSurface when possible

Previously, we were reinstantiating the DisplayListPlayer and
PaintingSurface on every paint.
This commit is contained in:
Jelle Raaijmakers 2025-01-29 10:24:57 +01:00 committed by Alexander Kalenik
commit 342cb7addf
Notes: github-actions[bot] 2025-01-31 12:29:12 +00:00
12 changed files with 107 additions and 104 deletions

View file

@ -41,6 +41,8 @@ void DisplayListPlayer::execute(DisplayList& display_list)
auto const& scroll_state = display_list.scroll_state();
auto device_pixels_per_css_pixel = display_list.device_pixels_per_css_pixel();
VERIFY(m_surface);
size_t next_command_index = 0;
while (next_command_index < commands.size()) {
auto scroll_frame_id = commands[next_command_index].scroll_frame_id;
@ -128,6 +130,8 @@ void DisplayListPlayer::execute(DisplayList& display_list)
else VERIFY_NOT_REACHED();
// clang-format on
}
flush();
}
}