summaryrefslogtreecommitdiff
path: root/src/Fl_Graphics_Driver.cxx
AgeCommit message (Collapse)Author
2020-11-12Fix for issue #155 - continuedManoloFLTK
The issue lies in details how floating point scaled coordinates are converted to integer values and its impact on the drawing of large SVG images. This commit fixes the X11 platform. The macOS platform is immune because drawing uses floating point coordinates. The Windows platform still needs fixing.
2020-09-23Add Doxygen doc of "static unsigned Fl_Graphics_Driver::need_pixmap_bg_color"ManoloFLTK
2020-07-30Fix use of an SVG image in Fl_Tiled_Image when display is rescaled.ManoloFLTK
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
2020-02-03Move fl_font(face, size) to fl_draw.cxxAlbrecht Schlosser
I believe this is a better place. Also: add FL_EXPORT since it's no longer inline.
2020-02-03Fix regression calling fl_font() w/o draw contextAlbrecht Schlosser
According to the documentation fl_font(face, size) may be called "outside a draw context if necessary to call fl_width()". This worked in 1.3.5 but did not in 1.4 (so far). I reworded the docs to make clear that other measurement functions can be called as well and refactored the code to make sure that fl_font(face, size) will open the display if necessary.
2020-01-20Improve documentation of clipping functionsAlbrecht Schlosser
Clarify functionality of fl_not_clipped() and fl_clip_box(). Add developer documentation for Fl_Graphics_Driver::clip_box(). Documentation only, no code changes in this commit.
2020-01-15Fix uninitialized vars in calls to fl_clip_box() (issue #6)Albrecht Schlosser
The main fixes are only to avoid static code analyzer warnings reported in issue #5, but there are also minor bug fixes included. These bug fixes are more of theoretical concerns though. Close #6.
2019-11-02Slightly simpler code to support fl_overlay_rect() on HighDPI screens.ManoloFLTK
2019-11-01Fix fl_overlay_rect() under X11 on HighDPI display.ManoloFLTK
The mandelbrot demo program is fixed.
2019-03-12Avoid "unused argument" compiler warnings with -Wextra after #include ↵ManoloFLTK
<fl_draw.H>
2019-02-02STR #2714: remove new shadow lint for MacOSMatthias Melcher
2018-12-04Define useful implementations of Fl_Graphics_Driver::push_no_clip() and ↵ManoloFLTK
pop_clip().
2018-12-04Give a meaningful default implementation to a few more member functions of ↵ManoloFLTK
class Fl_Graphics_Driver.
2018-08-07Fix for STR #3483: support for tiled images when the display is rescaled.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13009 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-26Move Fl_Screen_Driver.H from FL/ to src/Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12975 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-23Doxygen only: fixed all block comments starting with an asterisk to ↵Matthias Melcher
space-only, fixed doxygen keywords prepended with @ to use a backward slash instead. No code was changed. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12970 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-23Doxygen: created Group to document drivers, disabled by defaultMatthias Melcher
Uncomment `ENABLED_SECTIONS += DriverDev` in documentation/Doxyfile.in to enable driver documentation. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-13Fl_Scalable_Graphics_Driver::rect(): don't draw a rectangle if w or h is ↵Manolo Gouy
negative git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12920 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06Make member function Fl_Image_Surface::get_offscreen_before_delete() be private.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12904 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06Improve fl_overlay_rect() when GUI is scaled.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12901 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-03Fix fl_overlay_rect() under X11 and Windows when GUI is scaled.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12891 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-26Simplify API for Fl_Image_Surface::Fl_Image_Surface(int w, int h, int ↵Manolo Gouy
high_res, Fl_Offscreen off) with non-null offscreen. The caller no longer needs to call Fl_Image_Surface::get_offscreen_before_delete() before object deletion, because the object destructor knows the offscreen has not been created by the Fl_Image_Surface constructor. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12874 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-19Reorganise access to the value of the GUI scaling factor with public getter ↵Manolo Gouy
and protected, virtual setter member functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12858 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-19Documentation: place Doxygen doc next to function implementationManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12857 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-19Documentation: add doc for Fl_Graphics_Driver::cache_size()Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12856 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-18Simplify the implementation of printing of Fl_Pixmap images under Windows.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12851 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-13Homogenise and simplify the API of Fl_Graphics_Driver::cache(image-type *) ↵Manolo Gouy
virtual member functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12833 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12Image drawing: simplify the code organisation to better support ↵Manolo Gouy
Fl_Image::scale(). Graphics drivers now use up to 6 virtual member functions to support Fl_Image drawing in the context of GUI and image rescaling : virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy) and virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-28Image classes: memorise the width and the height of the cached form of the ↵Manolo Gouy
image to support GUI scaling git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12811 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-22Rename Fl_Image::pixel_w() and pixel_h() to Fl_Image::data_w() and data_h().Manolo Gouy
The docs of class Fl_Image and of Fl_Image::scale() are beefed up. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-19New member function Fl_Image::scale(int width, int height) to set the FLTK ↵Manolo Gouy
size of an image. Each image has now two sizes implemented as follows: - the pixel size is stored in private members pixel_w_ and pixel_h_ with public accessors pixel_w() and pixel_h() - the FLTK size is stored in private members w_ and h_ and read by w() and h() - when the image is constructed, the two sizes have the same value - the protected w(int) and h(int) member functions set both FLTK and pixel sizes. - the public scale(int, int) member function is essentially nothing but set the FLTK size and don't change the pixel size. - when the image is drawn, its FLTK size determines how big it is drawn, its pixel size determines how much data are available to draw it. FLTK 1.3.4 with FL_ABI_VERSION=10304 contained an equivalent member function but only for the Fl_Shared_Image class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12776 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09Replace "WIN32" with "_WIN32" or "Windows".Albrecht Schlosser
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32". Replace "WIN32" in text and documentation with "Windows". Replace "MSWindows" with "Windows". To do: README.Windows.txt (and maybe other documentation as well) needs updates. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09Fix fl_read_image() under MacOS platform when GUI is rescaled.Manolo Gouy
This commit also simplifies the platform-dependent support of fl_read_image(): only Fl_XXX_Screen_Driver::read_win_rectangle() contains platform-specific code to capture pixels from the current window or from an offscreen buffer. Platform-independent function Fl_Screen_Driver::traverse_to_gl_subwindows() captures subwindows that intersect with the area fl_read_image() targets. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12653 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-07STR#3450: Draw text with OpenGL using textures on all platforms.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12650 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31Replace FL/x.H with FL/platform.H - step 2 (STR #3435).Albrecht Schlosser
This second step replaces FL/x.H with FL/platform.H in all source files. Dependencies have been adjusted as well. This commit completes the replacement of FL/x.H with FL/platform.H. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-03Restore correct fl_overlay_rect() when GUI is scaled (was broken by commit ↵Manolo Gouy
r.12595) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12618 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27Support for GUI rescaling: fix fl_copy_offscreen() to PostScript surface ↵Manolo Gouy
under X11. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12608 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19Fix Fl_GDI_Graphics_Driver::uncache(Fl_RGB_Image*,...) that did not delete ↵Manolo Gouy
correctly the cached offscreen object. This bug was detected by a test program that rotates an SVG image. But it's not related to SVG, and concerns any Fl_RGB_Image on the WIN32 platform. It was introduced when image support was modified according to the driver model. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12600 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18STR#3320 continued: make sure there's no undrawn space between nested ↵Manolo Gouy
rectangles and images. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12595 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18STR#3444: Add MacOS support for application rescaling (not quite complete)Manolo Gouy
With this, most MacOS FLTK app can be scaled with command/+/-/0/ keystrokes. A scaling problem remains, visible in test/cube, where the "Test" string is not positioned correctly. GLUT apps can also be scaled (across platforms). SVG images are re-rasterized after app scaling for optimal drawing. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-09Make virtual member function Fl_Image::draw_scaled(int X, int Y, int W, int ↵Manolo Gouy
H) protected rather than private. Consequently, remove the trailing _ from its name reserved for private class members. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12433 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-30Create virtual Fl_Image::draw_scaled_(int X, int Y, int W, int H) and its ↵Manolo Gouy
implementations for image classes. This allows to use the virtual function mechanism to adapt scaled image drawing both to the image type and the graphics driver type. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12410 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-30Move Fl_Graphics_Driver::draw(Fl_Shared_Image* from Fl_Shared_Image.cxx to ↵Manolo Gouy
Fl_Graphics_Driver.cxx where it belongs. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12408 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-25Fl_Scalable_Graphics_Driver::draw(Fl_RGB_Image *,...) : change how the ↵Manolo Gouy
current scaling factor is taken into account. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12400 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-25X11 and WIN32: slightly change Fl_XXX_Graphics_Driver::cache(Fl_Pixmap*) to ↵Manolo Gouy
use the Fl_Image_Surface object. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12399 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-24X11 platform: cleaner implementation of changing the active drawing surface ↵Manolo Gouy
and maintaining clip regions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12396 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-20Simplify using Fl_XXX_Graphics_Driver::copy_offscreen() instead of ↵Manolo Gouy
Fl_Scalable_Graphics_Driver::copy_offscreen_unscaled() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12395 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-21Move line_width_ protected member variable from Fl_Xlib_Graphics_Driver to ↵Manolo Gouy
Fl_Scalable_Graphics_Driver git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12269 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-02Make sure the scaling factor has been initialised when setting a font.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12248 ea41ed52-d2ee-0310-a9c1-e6b18d33e121