Author: manolo
Date: 2011-04-12 04:38:43 -0700 (Tue, 12 Apr 2011)
New Revision: 8581
Log:
Following STR #2583, the behaviour of fl_draw_image() with d = 4 on Mac OS is
here
made consistent with other platforms, that is, the 4th byte of each pixel is
ignored
instead of treated as transparency data.
In the future, the fl_draw_image() signature may be extended with another
argument
that would describe if and how transparency information is available.
Modified:
branches/branch-1.3/src/fl_draw_image_mac.cxx
branches/branch-1.3/test/unittest_images.cxx
Modified: branches/branch-1.3/src/fl_draw_image_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_draw_image_mac.cxx 2011-04-12 10:08:58 UTC
(rev 8580)
+++ branches/branch-1.3/src/fl_draw_image_mac.cxx 2011-04-12 11:38:43 UTC
(rev 8581)
@@ -92,8 +92,8 @@
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:kCGImageAlphaNoneSkipLast,
+ //lut, delta&1?kCGImageAlphaNone:kCGImageAlphaLast,
src, 0L, false, kCGRenderingIntentDefault);
// draw the image into the destination context
if (img) {
Modified: branches/branch-1.3/test/unittest_images.cxx
===================================================================
--- branches/branch-1.3/test/unittest_images.cxx 2011-04-12 10:08:58 UTC
(rev 8580)
+++ branches/branch-1.3/test/unittest_images.cxx 2011-04-12 11:38:43 UTC
(rev 8581)
@@ -86,11 +86,7 @@
fl_color(FL_BLACK); fl_rectf(xx, yy, 130, 130);
fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 64, 64);
fl_color(FL_WHITE); fl_rectf(xx+65, yy+65, 64, 64);
-#ifdef __APPLE__
- fl_draw_image(img_rgba, xx+1, yy+1, 128, 128, 4); // Apple: okay w/alpha
-#else
i_rgba->draw(xx+1,yy+1); // only Fl_RGB_Image->draw() works with alpha
-#endif
fl_color(FL_BLACK); fl_draw("RGBA", xx+134, yy+64);
// top right: Gray
@@ -106,11 +102,7 @@
fl_color(FL_BLACK); fl_rectf(xx, yy, 130, 130);
fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 64, 64);
fl_color(FL_WHITE); fl_rectf(xx+65, yy+65, 64, 64);
-#ifdef __APPLE__
- fl_draw_image(img_gray_a, xx+1, yy+1, 128, 128, 2); // Apple: okay
w/alpha
-#else
i_ga->draw(xx+1,yy+1); // only Fl_RGB_Image->draw() works with alpha
-#endif
fl_color(FL_BLACK); fl_draw("Gray+Alpha", xx+134, yy+64);
}
};
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit