Comments only: extend the description of how Fl_Graphics_Driver derived classes support image classes.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12838 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-04-15 06:44:50 +00:00
parent dbc37a29c0
commit ecc1f90506

View File

@ -102,9 +102,9 @@ and
- The 1st group of functions is used when the driver can directly map the image data, - The 1st group of functions is used when the driver can directly map the image data,
sized at data_w() x data_h(), to the image drawing area, sized at w()*scale x h()*scale sized at data_w() x data_h(), to the image drawing area, sized at w()*scale x h()*scale
where scale is the current GUI scale factor. where scale is the current GUI scale factor.
- If the driver does not support such scale-and-draw operation, it should implement the - If the driver does not support such scale-and-draw operation for a given image type,
draw_fixed() function which is called by the library after the image has been internally it should implement the draw_fixed() function which is called by the library after the
resized to the drawing size and cached. image has been internally resized to the drawing size and cached.
- The platform-independent Fl_Graphics_Driver class implements the 1st group of functions. - The platform-independent Fl_Graphics_Driver class implements the 1st group of functions.
Each resizes the image, caches it, and calls the platform-specific implementation of Each resizes the image, caches it, and calls the platform-specific implementation of
draw_fixed(image-class *,....) with the cached image. draw_fixed(image-class *,....) with the cached image.
@ -119,13 +119,17 @@ and
only draw_fixed() as in these examples: only draw_fixed() as in these examples:
- Fl_Quartz_Graphics_Driver implements only draw_rgb(Fl_RGB_Image *,....) because it - Fl_Quartz_Graphics_Driver implements only draw_rgb(Fl_RGB_Image *,....) because it
can perform the scale-and-draw operation whatever the RGB image and the required scaling. can perform the scale-and-draw operation whatever the RGB image and the required scaling.
- Fl_GDI_Graphics_Driver implements only draw_fixed(Fl_Pixmap *,....). The library - Fl_Xlib_Graphics_Driver implements only draw_fixed(Fl_Pixmap *,....). The library
takes care of resizing and caching the Pixmap to the adequate drawing size. takes care of resizing and caching the Pixmap to the adequate drawing size.
- Some drivers implement one function from both groups for a given image class : - Some drivers implement, for a given image class, the function of both groups, e.g. :
- Fl_Xlib_Graphics_Driver implements both draw_rgb(Fl_RGB_Image *,....) and Fl_GDI_Graphics_Driver implements both draw_rgb(Fl_RGB_Image *,....) and
draw_fixed(Fl_RGB_Image *,....) because scale-and-draw is possible only in the draw_fixed(Fl_RGB_Image *,....) because scale-and-draw may require function Alphablend()
presence of Xrender. In the absence of Xrender, the draw_rgb() implementation calls from MSIMG32.DLL. In the absence of that, the draw_rgb() implementation calls
Fl_Graphics_Driver::draw_rgb() which runs Fl_Xlib_Graphics_Driver::draw_fixed(Fl_RGB_Image*,...). Fl_Graphics_Driver::draw_rgb() which runs Fl_GDI_Graphics_Driver::draw_fixed(Fl_RGB_Image*,...).
Graphics drivers also implement cache(Fl_Pixmap*), cache(Fl_Bitmap*) and cache(Fl_RGB_Image*)
to compute the cached form of all image types, and uncache(Fl_RGB_Image *img,...) and
uncache_pixmap(fl_uintptr_t p) to destroy cached image forms.
*/ */
private: private:
virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy) {} virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy) {}