summaryrefslogtreecommitdiff
path: root/src/fl_draw_pixmap.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-02-10 14:33:51 +0000
committerManolo Gouy <Manolo>2015-02-10 14:33:51 +0000
commitdb8a39ae4588c191524a1b4898b9c4f5720fff52 (patch)
tree0c4e13849d5ed2aec887bf49e8669a3f5d4a3f72 /src/fl_draw_pixmap.cxx
parent998a6be711e96695f8d920ae0926f7c067d939a2 (diff)
Mac OS: more parsimonious memory usage when drawing Fl_RGB_Image. The image data are no longer duplicated when printing an image with
alloc_array = 1. Duplication remains when printing with alloc_array = 0. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10568 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_draw_pixmap.cxx')
-rw-r--r--src/fl_draw_pixmap.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx
index afb0935b7..ff5f1985f 100644
--- a/src/fl_draw_pixmap.cxx
+++ b/src/fl_draw_pixmap.cxx
@@ -253,8 +253,10 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
#ifdef __APPLE_QUARTZ__
if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) {
Fl_RGB_Image* rgb = new Fl_RGB_Image(buffer, w, h, 4);
+ rgb->alloc_array = 1;
rgb->draw(x, y);
delete rgb;
+ return 1;
} else {
#endif // __APPLE_QUARTZ__
// build the mask bitmap used by Fl_Pixmap: