mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +00:00
LibWeb: Use FillRect command in RecordingPainter if corners radius is 0
This change makes RecordingPainter to emit a FillRect command instead of FillRectWithRoundedCorners if all corners have a radius = 0. `fill_rect_with_rounded_corners()` in LibGfx already has a similar optimization. But now when we also have LibAccelGfx, which does not support painting rectangles with rounded corners yet, it makes sense to emit FillRect whenever possible.
This commit is contained in:
parent
b6732b0234
commit
92461a2618
1 changed files with 5 additions and 0 deletions
|
@ -352,6 +352,11 @@ void RecordingPainter::paint_text_shadow(int blur_radius, Gfx::IntRect bounding_
|
|||
|
||||
void RecordingPainter::fill_rect_with_rounded_corners(Gfx::IntRect const& rect, Color color, Gfx::AntiAliasingPainter::CornerRadius top_left_radius, Gfx::AntiAliasingPainter::CornerRadius top_right_radius, Gfx::AntiAliasingPainter::CornerRadius bottom_right_radius, Gfx::AntiAliasingPainter::CornerRadius bottom_left_radius)
|
||||
{
|
||||
if (!top_left_radius && !top_right_radius && !bottom_right_radius && !bottom_left_radius) {
|
||||
fill_rect(rect, color);
|
||||
return;
|
||||
}
|
||||
|
||||
push_command(FillRectWithRoundedCorners {
|
||||
.rect = state().translation.map(rect),
|
||||
.color = color,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue