1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:47:34 +00:00

LibGfx: AntiAliasingPainter::draw_circle/fill_rect_with_rounded_corners

Follows the efficient algorithm from this paper:
https://cs.uwaterloo.ca/research/tr/1984/CS-84-38.pdf

Can be extended ellipses in future.
This commit is contained in:
MacDue 2022-03-10 02:21:02 +00:00 committed by Andreas Kling
parent 913374163c
commit 51e54ab1ba
4 changed files with 238 additions and 4 deletions

View file

@ -28,6 +28,10 @@ public:
void translate(float dx, float dy) { m_transform.translate(dx, dy); }
void translate(FloatPoint const& delta) { m_transform.translate(delta); }
void draw_circle(IntPoint center, int radius, Color);
void fill_rect_with_rounded_corners(IntRect const&, Color, int radius);
void fill_rect_with_rounded_corners(IntRect const&, Color, int top_left_radius, int top_right_radius, int bottom_right_radius, int bottom_left_radius);
private:
enum class AntiAliasPolicy {
OnlyEnds,