summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToma┼ż Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-07-03 14:38:24 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-08-18 09:50:24 +0000
commitdfac25d2300b56ee4594346a4b5ce8b083a5c782 (patch)
tree5b6d7a0ac8aa7b00b9c38c189074136b11a0e18f
parent3c6cdfe08420eefaa97d957c3908daf76b14e684 (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). (cherry picked from commit f7f0486376adbabf3ea66bfd8a7b692c335ec3c8) Change-Id: I4800b3364fd00f5f4a8f5a459472bfa8d97827ba Reviewed-on: https://gerrit.libreoffice.org/17707 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 c71380e32337..63871928698f 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -507,7 +507,11 @@ GLXFBConfig OpenGLHelper::GetPixmapFBConfig( Display* pDisplay, bool& bInverted
}
glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_Y_INVERTED_EXT, &nValue );
- bInverted = (nValue == True) ? true : false;
+
+ // 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;
}