summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-18 10:13:40 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-21 15:56:26 +0000
commitf1252d8c24a59833596c17fed1ef6320d2e72609 (patch)
treed7f52e073e1f04687e4453a5cd9e0522be6abbb4
parent4ddd39181a9bc75eb63e47903a4c7b23eb3ab6bd (diff)
ifix the OpenGL UI config part
Change-Id: I931a4b618f35188e4e0cca07305ff15bbbacc20a Reviewed-on: https://gerrit.libreoffice.org/13520 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--cui/source/options/optgdlg.cxx2
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx19
2 files changed, 18 insertions, 3 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ffe4bdad652c..842e453d1571 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -145,7 +145,7 @@ OpenGLCfg::~OpenGLCfg()
boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
officecfg::Office::Common::VCL::UseOpenGL::set(mbUseOpenGL, batch);
officecfg::Office::Common::VCL::ForceOpenGL::set(mbForceOpenGL, batch);
-
+ batch->commit();
}
}
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 7f4cf361ef1c..a30b9ef5d983 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -401,6 +401,17 @@ bool OpenGLHelper::supportsVCLOpenGL()
bool OpenGLHelper::isVCLOpenGLEnabled()
{
+ /**
+ * The !bSet part should only be called once! Changing the results in the same
+ * run will mix OpenGL and normal rendering.
+ */
+ static bool bSet = false;
+ static bool bEnable = false;
+ static bool bForceOpenGL = false;
+ if (bSet)
+ {
+ return bForceOpenGL || bEnable;
+ }
/*
* There are a number of cases that these environment variables cover:
* * SAL_FORCEGL forces OpenGL independent of any other option
@@ -408,16 +419,20 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
* * SAL_ENABLEGL overrides VCL_HIDE_WINDOWS and the configuration variable
* * the configuration variable is checked if no environment variable is set
*/
- static bool bForceOpenGL = !!getenv("SAL_FORCEGL") || officecfg::Office::Common::VCL::ForceOpenGL::get();
+
+ bSet = true;
+ bForceOpenGL = !!getenv("SAL_FORCEGL") || officecfg::Office::Common::VCL::ForceOpenGL::get();
if (bForceOpenGL)
return true;
if (!supportsVCLOpenGL())
+ {
return false;
+ }
static bool bEnableGLEnv = !!getenv("SAL_ENABLEGL");
- bool bEnable = bEnableGLEnv;
+ bEnable = bEnableGLEnv;
static bool bDuringBuild = getenv("VCL_HIDE_WINDOWS");
if (bDuringBuild && !bEnable /* env. enable overrides */)