From 45e539fff80a5b0040d517f01d82b7aa6cdb7d31 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 1 Feb 2011 10:13:54 +0000 Subject: fl_draw_image() on Mac OS and to a printer requires the image data to be kept until the page is finished. Thus, we now duplicate this data when the output is a printer, so the caller of the function does not have to take into account this Mac OS specificity. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8349 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_draw_image_mac.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/fl_draw_image_mac.cxx') diff --git a/src/fl_draw_image_mac.cxx b/src/fl_draw_image_mac.cxx index 84b904436..72c34f888 100644 --- a/src/fl_draw_image_mac.cxx +++ b/src/fl_draw_image_mac.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #define MAXBUFFER 0x40000 // 256k @@ -39,7 +40,7 @@ static void dataReleaseCB(void *info, const void *data, size_t size) delete[] (uchar *)data; } -/** +/* * draw an image based on the input parameters * * buf: image source data @@ -63,10 +64,14 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, const void *array = buf; uchar *tmpBuf = 0; - if (cb) { + if (cb || Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) { tmpBuf = new uchar[ H*W*delta ]; - for (int i=0; i