From c3f1877fd111d9d708ef03470e6723d7ce2e24a1 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 10 Apr 2016 18:22:57 +0000 Subject: Remove platform-dependent code from Fl_PNG_Image.cxx git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11574 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_PNG_Image.cxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/Fl_PNG_Image.cxx') diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx index 1d94e9803..aa9635ee9 100644 --- a/src/Fl_PNG_Image.cxx +++ b/src/Fl_PNG_Image.cxx @@ -26,10 +26,11 @@ // Include necessary header files... // +#include #include +#include #include #include -#include #include #include #include @@ -206,15 +207,7 @@ void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_p for (i = png_set_interlace_handling(pp); i > 0; i --) png_read_rows(pp, rows, NULL, h()); -#ifdef WIN32 - // Some Windows graphics drivers don't honor transparency when RGB == white - if (channels == 4) { - // Convert RGB to 0 when alpha == 0... - uchar *ptr = (uchar *)array; - for (i = w() * h(); i > 0; i --, ptr += 4) - if (!ptr[3]) ptr[0] = ptr[1] = ptr[2] = 0; - } -#endif // WIN32 + if (channels == 4) Fl::system_driver()->png_extra_rgba_processing((uchar*)array, w(), h()); // Free memory and return... delete[] rows; -- cgit v1.2.3