summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-10 18:22:57 +0000
committerManolo Gouy <Manolo>2016-04-10 18:22:57 +0000
commitc3f1877fd111d9d708ef03470e6723d7ce2e24a1 (patch)
tree23ea1db3bde3df90f99b4e5929133081255416b7 /src/drivers
parentf9369a74ef156d01e678111fb0de475c1cde98eb (diff)
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
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H1
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
index e5bfb41b8..5e580f15c 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
@@ -83,6 +83,7 @@ public:
virtual char *preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor,
const char *application);
virtual void *dlopen(const char *filename);
+ virtual void png_extra_rgba_processing(unsigned char *array, int w, int h);
};
#endif // FL_WINAPI_SYSTEM_DRIVER_H
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index 9df5b2f71..529f9ade7 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -868,6 +868,14 @@ void *Fl_WinAPI_System_Driver::dlopen(const char *filename)
return LoadLibrary(filename);
}
+void Fl_WinAPI_System_Driver::png_extra_rgba_processing(unsigned char *ptr, int w, int h)
+{
+ // Some Windows graphics drivers don't honor transparency when RGB == white
+ // Convert RGB to 0 when alpha == 0...
+ for (int i = w * h; i > 0; i --, ptr += 4) {
+ if (!ptr[3]) ptr[0] = ptr[1] = ptr[2] = 0;
+ }
+}
//
// End of "$Id$".