mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:38:10 +00:00
LibWeb: Introduce dedicated painting command for borders
Currently, in CPU painter, border painting is implemented by building a Gfx::Path that is filled by Gfx::AntiAliasingPainter. In the GPU painter, we will likely want to do something different, and with a special command, it becomes possible. Also, by making this change, the CPU executor also benefits because now we can skip building paths for borders that are out of the viewport.
This commit is contained in:
parent
70353b79af
commit
29ff1f67be
11 changed files with 50 additions and 12 deletions
|
@ -134,9 +134,9 @@ void InlinePaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
|
||||
border_radii_data.inflate(outline_data->top.width + outline_offset_y, outline_data->right.width + outline_offset_x, outline_data->bottom.width + outline_offset_y, outline_data->left.width + outline_offset_x);
|
||||
borders_rect.inflate(outline_data->top.width + outline_offset_y, outline_data->right.width + outline_offset_x, outline_data->bottom.width + outline_offset_y, outline_data->left.width + outline_offset_x);
|
||||
paint_all_borders(context.painter(), context.rounded_device_rect(borders_rect), border_radii_data.as_corners(context), outline_data->to_device_pixels(context));
|
||||
context.painter().paint_borders(context.rounded_device_rect(borders_rect), border_radii_data.as_corners(context), outline_data->to_device_pixels(context));
|
||||
} else {
|
||||
paint_all_borders(context.painter(), context.rounded_device_rect(borders_rect), border_radii_data.as_corners(context), borders_data.to_device_pixels(context));
|
||||
context.painter().paint_borders(context.rounded_device_rect(borders_rect), border_radii_data.as_corners(context), borders_data.to_device_pixels(context));
|
||||
}
|
||||
|
||||
return IterationDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue