summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-02-11 08:59:26 +0000
committerManolo Gouy <Manolo>2015-02-11 08:59:26 +0000
commit9cb0516301f030235dd955d0233ab30c7d8495bf (patch)
treea9e16eeaeb71be7362aea617c093760bb5a72698 /src
parent1b38bbdd2e58f62009f958fe0bb87131c0897ebb (diff)
Fixed error introduced at r.10568 that prevented non-Apple compilation.
Also, replaced __APPLE_QUARTZ__ by __APPLE__ git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10571 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Image.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index b9b324004..3df1efde4 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -197,12 +197,17 @@ Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg):
/** The destructor frees all memory and server resources that are used by the image. */
Fl_RGB_Image::~Fl_RGB_Image() {
+#ifdef __APPLE__
if (id_) CGImageRelease((CGImageRef)id_);
else if (alloc_array) delete[] (uchar *)array;
+#else
+ uncache();
+ if (alloc_array) delete[] (uchar *)array;
+#endif
}
void Fl_RGB_Image::uncache() {
-#ifdef __APPLE_QUARTZ__
+#ifdef __APPLE__
if (id_) {
if (mask_) *(bool*)mask_ = false;
CGImageRelease((CGImageRef)id_);
@@ -464,7 +469,7 @@ void Fl_RGB_Image::desaturate() {
d(new_d);
}
-#if !defined(WIN32) && !defined(__APPLE_QUARTZ__)
+#if !defined(WIN32) && !defined(__APPLE__)
// Composite an image with alpha on systems that don't have accelerated
// alpha compositing...
static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, int cy) {
@@ -521,7 +526,7 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
delete[] dst;
}
-#endif // !WIN32 && !__APPLE_QUARTZ__
+#endif // !WIN32 && !__APPLE__
void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
fl_graphics_driver->draw(this, XP, YP, WP, HP, cx, cy);