diff options
Diffstat (limited to 'src/fl_read_image_mac.cxx')
| -rw-r--r-- | src/fl_read_image_mac.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/fl_read_image_mac.cxx b/src/fl_read_image_mac.cxx index 3cdbd48c4..6a1ba7a67 100644 --- a/src/fl_read_image_mac.cxx +++ b/src/fl_read_image_mac.cxx @@ -43,7 +43,7 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate int alpha) { // I - Alpha value for image (0 for none) Rect src, // Source rectangle dst; // Destination rectangle - Fl_Offscreen osbuffer; // Temporary off-screen buffer for copy + GWorldPtr osbuffer; // Temporary off-screen buffer for copy GrafPtr srcPort; // Source port RGBColor rgb; // RGB colors for copy mask... PixMapHandle pm; // Pixmap handle for off-screen buffer @@ -54,12 +54,6 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate int d; // Depth of image int rowBytes; // Number of bytes per row... - - // Get an off-screen buffer for copying the image... - osbuffer = fl_create_offscreen(w,h); - - if (!osbuffer) return 0; - // Set the source and destination rectangles... src.top = y; src.left = x; @@ -71,6 +65,14 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate dst.bottom = h; dst.right = w; + // Get an off-screen buffer for copying the image... + QDErr err = NewGWorld(&osbuffer, 0, &dst, 0L, 0L, 0); + if (!osbuffer) return 0; + if (err!=noErr) { + DisposeGWorld(osbuffer); + return 0; + } + // Get the source port... GetPort(&srcPort); @@ -121,10 +123,9 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate pdst[2] = psrc[2]; } #endif // __i386__ - // Unlock and delete the off-screen buffer, then return... UnlockPixels(pm); - fl_delete_offscreen(osbuffer); + DisposeGWorld(osbuffer); SetPort(srcPort); return p; |
