summaryrefslogtreecommitdiff
path: root/vcl/source/opengl/OpenGLHelper.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-20 09:52:03 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-20 13:50:51 +0100
commita55f740045d6d30e1ef5522889d2dc359ca5784a (patch)
treecf05fa9cd35419dc488e96f23c67d4eb308f71e0 /vcl/source/opengl/OpenGLHelper.cxx
parentdcdc8df2e6d740dd75ff6e28727ca757e4882f86 (diff)
include the unx part for getting OpenGL driver & device information
desktop/unx/source/glxtest.cxx is taken directly from the Mozilla project. THe whole concept is taken from Mozilla and is based on starting an early process that creates an OpenGL context. This prevents crashing drivers to crash Libreoffice. We read the information from the pipe as soon as we create the first vcl Window. In that place we then decide if the device/driver combination is blacklisted. Change-Id: I2624d4ce06d503281a4459cf3174f57cf1f7b733
Diffstat (limited to 'vcl/source/opengl/OpenGLHelper.cxx')
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 202ac2b095f6..df8b6d897bfe 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -22,6 +22,10 @@
#include <vector>
+#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
+#include "opengl/x11/X11DeviceInfo.hxx"
+#endif
+
namespace {
OUString getShaderFolder()
@@ -360,11 +364,31 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
}
}
+bool OpenGLHelper::isDeviceBlacklisted()
+{
+ static bool bSet = false;
+ static bool bBlacklisted = true; // assume the worst
+ if (!bSet)
+ {
+#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
+ X11OpenGLDeviceInfo aInfo;
+ bBlacklisted = aInfo.isDeviceBlocked();
+ SAL_INFO("vcl.opengl", "blacklisted: " << bBlacklisted);
+#else
+ bBlacklisted = false;
+#endif
+ bSet = true;
+ }
+
+ return bBlacklisted;
+}
+
bool OpenGLHelper::supportsVCLOpenGL()
{
static bool bDisableGL = !!getenv("SAL_DISABLEGL");
+ bool bBlacklisted = isDeviceBlacklisted();
- if (bDisableGL)
+ if (bDisableGL || bBlacklisted)
return false;
else
return true;