summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-01-13 19:32:24 +0100
committerMatthias Melcher <github@matthiasm.com>2024-01-13 19:32:32 +0100
commit332a87aa4357c3138ebf4774efdc1243061f5d44 (patch)
tree10be0d64bf6627d8148d3b519d04fbfa36f420b1 /FL
parent994b5824dccbc86c981bf0834d00579ef67c5539 (diff)
#887: Fixes Fl_Shared_Image reference counting
- adds documentation to all calls - changes implementation details on ::copy() and copy(w,h)
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Image.H2
-rw-r--r--FL/Fl_Shared_Image.H12
2 files changed, 10 insertions, 4 deletions
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index a8f514f36..8b8b433e8 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -259,7 +259,7 @@ public:
\note Since FLTK 1.4.0 this method is 'const'. If you derive your own class
from Fl_Image or any subclass your overridden methods of 'Fl_Image::copy() const'
- and 'Fl_Image::copy(int, int) const' \b must also be 'const' for inheritage
+ and 'Fl_Image::copy(int, int) const' \b must also be 'const' for inheritance
to work properly. This is different than in FLTK 1.3.x and earlier where these
methods have not been 'const'.
*/
diff --git a/FL/Fl_Shared_Image.H b/FL/Fl_Shared_Image.H
index 554197396..acecebf83 100644
--- a/FL/Fl_Shared_Image.H
+++ b/FL/Fl_Shared_Image.H
@@ -22,6 +22,7 @@
# include "Fl_Image.H"
+#undef SHIM_DEBUG
/** Test function (typedef) for adding new shared image formats.
@@ -120,8 +121,13 @@ protected:
virtual ~Fl_Shared_Image();
void add();
void update();
+ Fl_Shared_Image *copy_(int W, int H) const;
public:
+#ifdef SHIM_DEBUG
+ static void print_pool();
+#endif
+
/** Returns the filename of the shared image */
const char *name() { return name_; }
@@ -147,9 +153,9 @@ public:
}
Fl_Image *copy(int W, int H) const FL_OVERRIDE;
- Fl_Image *copy() const {
- return Fl_Image::copy();
- }
+ Fl_Image *copy() const;
+ Fl_Image *copy();
+
void color_average(Fl_Color c, float i) FL_OVERRIDE;
void desaturate() FL_OVERRIDE;
void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0) FL_OVERRIDE;