From 14759eb3872f113b36902e0f165a1224a8065789 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 25 Feb 2016 07:01:10 +0000 Subject: Mac OS platform: make fl_draw_image() draw correctly depth-4 images with transparent areas. This simplifies the drawing of Fl_Pixmap's. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11214 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 3 +-- src/fl_draw_pixmap.cxx | 13 ------------- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'src') diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 70d7986e1..a72e09b1e 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -85,8 +85,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, tmpBuf ? dataReleaseCB : NULL ); CGImageRef img = CGImageCreate( W, H, 8, 8*delta, linedelta, - lut, delta&1?kCGImageAlphaNone:kCGImageAlphaNoneSkipLast, - //lut, delta&1?kCGImageAlphaNone:kCGImageAlphaLast, + lut, delta&1?kCGImageAlphaNone:kCGImageAlphaLast, src, 0L, false, kCGRenderingIntentDefault); // draw the image into the destination context if (img) { diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx index 7bb5fcdcb..544965185 100644 --- a/src/fl_draw_pixmap.cxx +++ b/src/fl_draw_pixmap.cxx @@ -255,16 +255,6 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { return 0; } - // FIXME: Hack until fl_draw_image() supports alpha properly -#ifdef __APPLE_QUARTZ__ // PORTME: Fl_Graphics_Driver - platform pixmap - if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { - 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__ // PORTME: Fl_Graphics_Driver - platform pixmap // build the mask bitmap used by Fl_Pixmap: if (fl_mask_bitmap) { int W = (w+7)/8; @@ -289,9 +279,6 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { fl_draw_image(buffer, x, y, w, h, 4); -#ifdef __APPLE_QUARTZ__ // PORTME: Fl_Graphics_Driver - platform pixmap - } -#endif delete[] buffer; return 1; } -- cgit v1.2.3