LibGfx: Remove OffsetPaintStyle

This commit is contained in:
Pavel Shliak 2024-11-10 16:28:02 +04:00 committed by Alexander Kalenik
parent 9ee7d4d90a
commit b4e5afa8d5
Notes: github-actions[bot] 2024-11-10 23:08:11 +00:00

View file

@ -113,33 +113,6 @@ private:
Color m_fallback;
};
class OffsetPaintStyle : public Gfx::PaintStyle {
public:
static ErrorOr<NonnullRefPtr<OffsetPaintStyle>> create(RefPtr<PaintStyle> other, Gfx::AffineTransform transform)
{
return adopt_nonnull_ref_or_enomem(new (nothrow) OffsetPaintStyle(move(other), transform));
}
virtual void paint(Gfx::IntRect physical_bounding_box, PaintFunction paint) const override
{
m_other->paint(m_transform.map(physical_bounding_box), [=, this, paint = move(paint)](SamplerFunction sampler) {
paint([=, this, sampler = move(sampler)](Gfx::IntPoint point) {
return sampler(m_transform.map(point));
});
});
}
private:
OffsetPaintStyle(RefPtr<PaintStyle> other, Gfx::AffineTransform transform)
: m_other(move(other))
, m_transform(transform)
{
}
RefPtr<PaintStyle> m_other;
Gfx::AffineTransform m_transform;
};
class GradientPaintStyle : public PaintStyle {
public:
ErrorOr<void> add_color_stop(float position, Color color, Optional<float> transition_hint = {})