FLTK logo

[master] 2931c29 - Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size()

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 2931c29 - Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size() "ManoloFLTK" Nov 17, 2020  
 
commit 2931c29689a91375e610a6a8bca28fe2b10b268f
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Nov 17 11:23:24 2020 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Nov 17 11:23:35 2020 +0100

    Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size()

 FL/Fl_Image.H              | 3 ++-
 src/Fl_Graphics_Driver.cxx | 5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git FL/Fl_Image.H FL/Fl_Image.H
index 9151977..4b5419c 100644
--- FL/Fl_Image.H
+++ FL/Fl_Image.H
@@ -75,6 +75,8 @@ private:
   // Forbid use of copy constructor and assign operator
   Fl_Image & operator=(const Fl_Image &);
   Fl_Image(const Fl_Image &);
+  // Presently redefined in Fl_SVG_Image
+  virtual void cache_size(int &width, int &height) {}
 
 protected:
 
@@ -302,7 +304,6 @@ private:
   fl_uintptr_t id_;
   fl_uintptr_t mask_;
   int cache_w_, cache_h_; // size of image when cached
-  virtual void cache_size(int &width, int &height) {}
 public:
 
   Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0);
diff --git src/Fl_Graphics_Driver.cxx src/Fl_Graphics_Driver.cxx
index 607d148..988794c 100644
--- src/Fl_Graphics_Driver.cxx
+++ src/Fl_Graphics_Driver.cxx
@@ -210,10 +210,7 @@ void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height)
     width  = (width+1) * scale();
     height = (height+1) * scale();
   }
-  if (img->d() == 4) { // check for depth-4 RGB image
-    Fl_RGB_Image *rgb = (Fl_RGB_Image*)img;
-    rgb->cache_size(width, height);
-  }
+  img->cache_size(width, height);
 }
 
 /** Draws an Fl_Pixmap object using this graphics driver.
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.