From 22e2e1dc931e3256837993553c781d1968d7ee62 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 4 Jul 2022 21:06:34 +0100 Subject: [PATCH] LibWeb: Use ScopedCornerRadiusClip for background painting --- .../Libraries/LibWeb/Painting/BackgroundPainting.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp b/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp index 14cc8d478d2..c2317ec65fd 100644 --- a/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp @@ -89,17 +89,10 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet auto& image = *layer.image->bitmap(); // Clip - Optional corner_radius_clipper {}; auto clip_box = get_box(layer.clip); auto clip_rect = clip_box.rect.to_rounded(); - if (clip_box.radii.has_any_radius()) { - auto clipper = BorderRadiusCornerClipper::create(clip_rect, clip_box.radii); - if (!clipper.is_error()) { - corner_radius_clipper = clipper.release_value(); - corner_radius_clipper->sample_under_corners(painter); - } - } painter.add_clip_rect(clip_rect); + ScopedCornerRadiusClip corner_clip { painter, clip_rect, clip_box.radii }; Gfx::FloatRect background_positioning_area; @@ -292,9 +285,6 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet break; image_y += y_step; } - - if (corner_radius_clipper.has_value()) - corner_radius_clipper->blit_corner_clipping(painter); } }