Skip to content

Commit e4adaa2

Browse files
MacDueawesomekling
authored andcommitted
LibGfx: Make PaintStyle::paint() a public function
It's a pain (and silly) to make this private and add every user as a friend.
1 parent 81ff242 commit e4adaa2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Userland/Libraries/LibGfx/PaintStyle.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,17 @@ class PaintStyle : public RefCounted<PaintStyle> {
2626
using SamplerFunction = Function<Color(IntPoint)>;
2727
using PaintFunction = Function<void(SamplerFunction)>;
2828

29-
friend Painter;
30-
friend AntiAliasingPainter;
31-
32-
private:
33-
// Simple paint styles can simply override sample_color() if they can easily generate a color from a coordinate.
34-
virtual Color sample_color(IntPoint) const { return Color(); };
35-
3629
// Paint styles that have paint time dependent state (e.g. based on the paint size) may find it easier to override paint().
3730
// If paint() is overridden sample_color() is unused.
3831
virtual void paint(IntRect physical_bounding_box, PaintFunction paint) const
3932
{
4033
(void)physical_bounding_box;
4134
paint([this](IntPoint point) { return sample_color(point); });
4235
}
36+
37+
private:
38+
// Simple paint styles can simply override sample_color() if they can easily generate a color from a coordinate.
39+
virtual Color sample_color(IntPoint) const { return Color(); };
4340
};
4441

4542
class SolidColorPaintStyle final : public PaintStyle {

0 commit comments

Comments
 (0)