diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-18 10:13:40 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-12-18 10:20:12 +0100 |
commit | ae177f5b9965684c1a358aa43e5957cff218210b (patch) | |
tree | 09489ec6ba76511e7753a3d270734d1791b0e3c6 | |
parent | 146bd125a01742b2a6561a4a23735f37867d8221 (diff) |
ifix the OpenGL UI config part
Change-Id: I931a4b618f35188e4e0cca07305ff15bbbacc20a
-rw-r--r-- | cui/source/options/optgdlg.cxx | 2 | ||||
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 55222bc92e3a..28e0677ce7ac 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -146,7 +146,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 */) |