mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 12:17:45 +00:00
LibGfx: Add fast path to AA line drawing with simple 2D transform
If the effective 2D transform is just a basic translation, we now simply translate the underlying painter before & after drawing AA lines. This avoids all the extra math that otherwise has to happen when mapping points through an affine transform. This noticeably increase "mousing around" performance on Wikipedia. :^)
This commit is contained in:
parent
b4c3882d9c
commit
908d42d0ba
2 changed files with 31 additions and 8 deletions
|
@ -37,8 +37,8 @@ private:
|
|||
OnlyEnds,
|
||||
Full,
|
||||
};
|
||||
template<AntiAliasPolicy policy>
|
||||
void draw_anti_aliased_line(FloatPoint const&, FloatPoint const&, Color, float thickness, Painter::LineStyle style, Color alternate_color);
|
||||
template<AntiAliasPolicy policy, typename TransformPoint>
|
||||
void draw_anti_aliased_line(FloatPoint const&, FloatPoint const&, Color, float thickness, Painter::LineStyle style, Color alternate_color, TransformPoint);
|
||||
|
||||
Painter& m_underlying_painter;
|
||||
AffineTransform m_transform;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue