summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-07-03 14:38:24 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-07-03 14:52:28 +0900
commitf7f0486376adbabf3ea66bfd8a7b692c335ec3c8 (patch)
treef601d7f1663fb266f8c266de4d6a92b05d9289a5
parent149e62670ed01f33612e841c8d17b6bd416e2d88 (diff)
tdf#88831 fix inverted textures when OpenGL is enabled
GLX returns a wrong value if the y coords are inverted. Most other programs don't even ask for this (gnome-shell for example) and just assumes "true" (and this works because most relevant X servers work like this). We make this more robust and assume true only if the returned value is GLX_DONT_CARE (-1). Change-Id: I4800b3364fd00f5f4a8f5a459472bfa8d97827ba
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 5663ccb3cb94..3ed6bdd1d637 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -539,7 +539,11 @@ GLXFBConfig OpenGLHelper::GetPixmapFBConfig( Display* pDisplay, bool& bInverted
}
glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_Y_INVERTED_EXT, &nValue );
- bInverted = nValue == True;
+
+ // Looks like that X sends GLX_DONT_CARE but this usually means "true" for most
+ // of the X implementations. Investigation on internet pointed that this could be
+ // safely "true" all the time (for example gnome-shell always assumes "true").
+ bInverted = nValue == True || nValue == int(GLX_DONT_CARE);
break;
}