From b027d2ba57a8e0d6f0862e0a891ddd5dee4b02e2 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 26 Feb 2021 18:00:07 +0100 Subject: Windows platform: use GDI+ to antialias oblique lines and curves. --- FL/Fl_Graphics_Driver.H | 2 ++ FL/fl_draw.H | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'FL') diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 67b7a31bd..5d03e2c43 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -374,6 +374,8 @@ public: virtual float override_scale(); virtual void restore_scale(float); virtual PangoFontDescription* pango_font_description(Fl_Font fnum) { return NULL; } + virtual void antialias(int state); + virtual int antialias(); }; #ifndef FL_DOXYGEN diff --git a/FL/fl_draw.H b/FL/fl_draw.H index a84f310f8..9e2e4b3dd 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -238,6 +238,16 @@ enum { FL_JOIN_BEVEL = 0x3000 ///< join style: line join is tidied }; +/** + Turns ON or OFF antialiased line drawings, if supported by platform. + Currently, only the Windows platform allows to change whether line drawings are antialiased. + Turning it OFF may accelerate heavy drawing operations. + */ +inline void fl_antialias(int state) { fl_graphics_driver->antialias(state); } + +/** Returns whether line drawings are currently antialiased */ +inline int fl_antialias() { return fl_graphics_driver->antialias(); } + // rectangles tweaked to exactly fill the pixel rectangle: /** -- cgit v1.2.3