From e4adaa2d20e98df4e2bdac81df8da94eb935af38 Mon Sep 17 00:00:00 2001 From: MacDue Date: Tue, 30 May 2023 19:02:00 +0100 Subject: [PATCH] LibGfx: Make PaintStyle::paint() a public function It's a pain (and silly) to make this private and add every user as a friend. --- Userland/Libraries/LibGfx/PaintStyle.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibGfx/PaintStyle.h b/Userland/Libraries/LibGfx/PaintStyle.h index ee17771180..ad0bea6a96 100644 --- a/Userland/Libraries/LibGfx/PaintStyle.h +++ b/Userland/Libraries/LibGfx/PaintStyle.h @@ -26,13 +26,6 @@ public: using SamplerFunction = Function; using PaintFunction = Function; - friend Painter; - friend AntiAliasingPainter; - -private: - // Simple paint styles can simply override sample_color() if they can easily generate a color from a coordinate. - virtual Color sample_color(IntPoint) const { return Color(); }; - // Paint styles that have paint time dependent state (e.g. based on the paint size) may find it easier to override paint(). // If paint() is overridden sample_color() is unused. virtual void paint(IntRect physical_bounding_box, PaintFunction paint) const @@ -40,6 +33,10 @@ private: (void)physical_bounding_box; paint([this](IntPoint point) { return sample_color(point); }); } + +private: + // Simple paint styles can simply override sample_color() if they can easily generate a color from a coordinate. + virtual Color sample_color(IntPoint) const { return Color(); }; }; class SolidColorPaintStyle final : public PaintStyle {