mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:08:12 +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
|
@ -92,13 +92,14 @@ RefPtr<Gfx::Bitmap> SVGGraphicsPaintable::calculate_mask(PaintContext& context,
|
|||
return {};
|
||||
mask_bitmap = mask_bitmap_or_error.release_value();
|
||||
{
|
||||
RecordingPainter painter;
|
||||
painter.translate(-mask_rect.location().to_type<int>());
|
||||
auto paint_context = context.clone(painter);
|
||||
CommandList painting_commands;
|
||||
RecordingPainter recording_painter(painting_commands);
|
||||
recording_painter.translate(-mask_rect.location().to_type<int>());
|
||||
auto paint_context = context.clone(recording_painter);
|
||||
paint_context.set_svg_transform(graphics_element.get_transform());
|
||||
StackingContext::paint_node_as_stacking_context(mask_paintable, paint_context);
|
||||
PaintingCommandExecutorCPU executor { *mask_bitmap };
|
||||
painter.execute(executor);
|
||||
painting_commands.execute(executor);
|
||||
}
|
||||
}
|
||||
return mask_bitmap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue