diff options
| author | Manolo Gouy <Manolo> | 2016-02-25 07:01:10 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-25 07:01:10 +0000 |
| commit | 14759eb3872f113b36902e0f165a1224a8065789 (patch) | |
| tree | 0ee0bb9db1974b200456de2dc0bb78725e2b0e5b /src | |
| parent | 6097c134d893c67aa6d3d56ee176531c481261a8 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 3 | ||||
| -rw-r--r-- | src/fl_draw_pixmap.cxx | 13 |
2 files changed, 1 insertions, 15 deletions
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; } |
