diff options
| author | Manolo Gouy <Manolo> | 2012-03-18 18:48:29 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-03-18 18:48:29 +0000 |
| commit | 32d4bc4099ac62a32166c9d39ddd47d6a193be2a (patch) | |
| tree | d01eab46321ea19780aa7ca0614cdd258885e368 /src/fl_draw_pixmap.cxx | |
| parent | 53ccc787591de6b4aea756f45c8d3cdd6611b818 (diff) | |
Fix STR#2810: removed all uses of function Fl_Device::class_name().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9293 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_draw_pixmap.cxx')
| -rw-r--r-- | src/fl_draw_pixmap.cxx | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx index 0bbc9057f..3c55559df 100644 --- a/src/fl_draw_pixmap.cxx +++ b/src/fl_draw_pixmap.cxx @@ -3,7 +3,7 @@ // // Pixmap drawing code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2012 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -332,9 +332,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { #endif #ifdef __APPLE_QUARTZ__ - if (fl_graphics_driver->class_name() == Fl_Quartz_Graphics_Driver::class_id ) { - bool transparent = (transparent_index>=0); - transparent = true; + if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) { U32 *array = new U32[d.w * d.h], *q = array; for (int Y = 0; Y < d.h; Y++) { const uchar* p = data[Y]; @@ -349,18 +347,9 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { } } } - CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB(); - CGDataProviderRef src = CGDataProviderCreateWithData( 0L, array, d.w * d.h * 4, 0L); - CGImageRef img = CGImageCreate(d.w, d.h, 8, 4*8, 4*d.w, - lut, transparent?kCGImageAlphaLast:kCGImageAlphaNoneSkipLast, - src, 0L, false, kCGRenderingIntentDefault); - CGColorSpaceRelease(lut); - CGDataProviderRelease(src); - CGRect rect = { { x, y} , { d.w, d.h } }; - Fl_X::q_begin_image(rect, 0, 0, d.w, d.h); - CGContextDrawImage(fl_gc, rect, img); - Fl_X::q_end_image(); - CGImageRelease(img); + Fl_RGB_Image* rgb = new Fl_RGB_Image((uchar*)array, d.w, d.h, 4); + rgb->draw(x, y); + delete rgb; delete[] array; } else { |
