diff options
author | MacDue <macdue@dueutil.tech> | 2022-07-04 21:07:10 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-04 23:09:06 +0200 |
commit | af21ee871785a718124d70b5c962e33827a14569 (patch) | |
tree | d0186d552adb5d8ce966af6938718da4a4ad286e /Userland/Libraries/LibWeb/Painting | |
parent | 22e2e1dc931e3256837993553c781d1968d7ee62 (diff) | |
download | serenity-af21ee871785a718124d70b5c962e33827a14569.zip |
LibWeb: Use ScopedCornerRadiusClip for shadow painting
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp index 40401cc887..a3a077428e 100644 --- a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp @@ -29,16 +29,7 @@ void paint_box_shadow(PaintContext& context, Gfx::IntRect const& content_rect, B auto bottom_right_corner = border_radii.bottom_right.as_corner(); auto bottom_left_corner = border_radii.bottom_left.as_corner(); - Optional<BorderRadiusCornerClipper> corner_radius_clipper {}; - - if (border_radii.has_any_radius()) { - auto clipper = BorderRadiusCornerClipper::create(content_rect, border_radii, CornerClip::Inside); - if (!clipper.is_error()) - corner_radius_clipper = clipper.release_value(); - } - - if (corner_radius_clipper.has_value()) - corner_radius_clipper->sample_under_corners(painter); + ScopedCornerRadiusClip corner_clipper { painter, content_rect, border_radii, CornerClip::Inside }; // Note: Box-shadow layers are ordered front-to-back, so we paint them in reverse for (auto& box_shadow_data : box_shadow_layers.in_reverse()) { @@ -326,9 +317,6 @@ void paint_box_shadow(PaintContext& context, Gfx::IntRect const& content_rect, B paint_shadow(bottom_left); } } - - if (corner_radius_clipper.has_value()) - corner_radius_clipper->blit_corner_clipping(painter); } void paint_text_shadow(PaintContext& context, Layout::LineBoxFragment const& fragment, Vector<ShadowData> const& shadow_layers) |