mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +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:
committed by
Andreas Kling
parent
ce9ad3a236
commit
11d746a67f
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user