mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:37:35 +00:00
LibGFX: Transform vertices when drawing antialiased lines
Previously we transformed each rasterized point when drawing a line. Now we transform the lines' endpoints instead. That means running two transforms per line instead of transforms for each pixel. It is not clear that the overhead for the fast path is still worth it. If we still want to optimize identity and translations, it is probably better to do that inside AffineTransform. In addition this will behave nicer if the transform includes scaling. Previously this would rasterize lines before scaling. Which means drawing too many points when scaling down, and not drawing enough points when scaling up. With the new approach we will automatically rasterize at pixel scale. This is essentially the same as OpenGL, where vertices are transformed and rasterization happens in screen space.
This commit is contained in:
parent
b4a8be5dc9
commit
af3174c9ce
2 changed files with 8 additions and 21 deletions
|
@ -37,7 +37,7 @@ private:
|
|||
OnlyEnds,
|
||||
Full,
|
||||
};
|
||||
template<AntiAliasPolicy policy, bool apply_transform>
|
||||
template<AntiAliasPolicy policy>
|
||||
void draw_anti_aliased_line(FloatPoint const&, FloatPoint const&, Color, float thickness, Painter::LineStyle style, Color alternate_color);
|
||||
|
||||
Painter& m_underlying_painter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue