summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Device_Plugin.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
commit50ee3bcd66c4baa6bb3388f5b955d726bfc6bdd8 (patch)
tree4b62978d21ee57df7027461b8ea2846c17308d11 /src/Fl_Gl_Device_Plugin.cxx
parenta3c0dac034c919c2714f3f129a9f5d9d26ae3de4 (diff)
Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Device_Plugin.cxx')
-rw-r--r--src/Fl_Gl_Device_Plugin.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx
index 2df739627..661b1a2d1 100644
--- a/src/Fl_Gl_Device_Plugin.cxx
+++ b/src/Fl_Gl_Device_Plugin.cxx
@@ -24,14 +24,14 @@
#include <FL/Fl_RGB_Image.H>
#include "FL/Fl.H"
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(WIN32) || defined(__APPLE__) // PORTME: platform OpenGL management
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement code to read OpenGL renderings into RGB maps"
#else
#endif
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: platform OpenGL management
uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth)
{
uchar *newimg = new uchar[3*w*h];
@@ -59,7 +59,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
stored from bottom to top.
*/
{
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: platform OpenGL management
const int bytesperpixel = 4;
int factor = glw->pixels_per_unit();
if (factor > 1) {
@@ -81,14 +81,14 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
mByteWidth = (mByteWidth + 3) & ~3; // Align to 4 bytes
uchar *baseAddress = new uchar[mByteWidth * h];
glReadPixels(x, glw->pixel_h() - (y+h), w, h,
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: platform OpenGL management
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
#else
GL_RGB, GL_UNSIGNED_BYTE,
#endif
baseAddress);
glPopClientAttrib();
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: platform OpenGL management
baseAddress = convert_BGRA_to_RGB(baseAddress, w, h, mByteWidth);
mByteWidth = 3 * w;
#endif
@@ -97,7 +97,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
return img;
}
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform OpenGL management
static void imgProviderReleaseData (void *info, const void *data, size_t size)
{
delete (Fl_RGB_Image *)info;
@@ -116,7 +116,7 @@ public:
Fl_Gl_Window *glw = w->as_gl_window();
if (!glw) return 0;
Fl_RGB_Image *img = capture_gl_rectangle(glw, 0, 0, glw->w(), glw->h());
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform OpenGL management
if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) {
// convert the image to CGImage, and draw it at full res (useful on retina display)
CGColorSpaceRef cSpace = CGColorSpaceCreateDeviceRGB();