mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibGfx: Remove OffsetPaintStyle
This commit is contained in:
parent
9ee7d4d90a
commit
b4e5afa8d5
Notes:
github-actions[bot]
2024-11-10 23:08:11 +00:00
Author: https://github.com/shlyakpavel Commit: https://github.com/LadybirdBrowser/ladybird/commit/b4e5afa8d52 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2266 Reviewed-by: https://github.com/kalenikaliaksandr
1 changed files with 0 additions and 27 deletions
|
@ -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 = {})
|
||||
|
|
Loading…
Reference in a new issue