mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
LibWeb+WebContent: Separate painting command list from RecordingPainter
Separating the recorder list from the painter will allow us to save it for later execution without carrying along the painter's state. This will be useful once we have a separate thread for executing painting commands, to which we will have to transfer commands from the main thread. Preparation for https://github.com/SerenityOS/serenity/pull/23108
This commit is contained in:
parent
ce9ad3a236
commit
11d746a67f
11 changed files with 874 additions and 732 deletions
|
@ -129,13 +129,14 @@ RefPtr<Gfx::Bitmap> SVGDecodedImageData::render(Gfx::IntSize size) const
|
|||
m_document->navigable()->set_viewport_rect({ 0, 0, size.width(), size.height() });
|
||||
m_document->update_layout();
|
||||
|
||||
Painting::RecordingPainter recording_painter;
|
||||
Painting::CommandList painting_commands;
|
||||
Painting::RecordingPainter recording_painter(painting_commands);
|
||||
PaintContext context(recording_painter, m_page_client->palette(), m_page_client->device_pixels_per_css_pixel());
|
||||
|
||||
m_document->paintable()->paint_all_phases(context);
|
||||
|
||||
Painting::PaintingCommandExecutorCPU executor { *bitmap };
|
||||
recording_painter.execute(executor);
|
||||
painting_commands.execute(executor);
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue