diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 3574adce5..daf26951c 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -53,91 +53,56 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, int delta, int linedelta, int mono, Fl_Draw_Image_Cb cb, void* userdata, CGContextRef gc) { - if (!linedelta) linedelta = W*delta; + if (!linedelta) linedelta = W*abs(delta); const void *array = buf; uchar *tmpBuf = 0; if (cb || Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) { - tmpBuf = new uchar[ H*W*delta ]; + tmpBuf = new uchar[ H*W*abs(delta) ]; if (cb) { for (int i=0; idraw_CGImage(img, X,Y,W,H, 0,0,W,H); - // release all allocated resources - CGImageRelease(img); - } CGColorSpaceRelease(lut); CGDataProviderRelease(src); - if (img) return; // else fall through to slow mode - // following the very save (and very slow) way to write the image into the give port - CGContextSetShouldAntialias(gc, false); - if ( cb ) - { - uchar *tmpBuf = new uchar[ W*4 ]; - for ( int i=0; idraw_CGImage(img, 0,0,W,H, 0,0,W,H); + CGImageRelease(img); } - CGContextSetShouldAntialias(gc, true); } void Fl_Quartz_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){