cui/source/options/optgdlg.cxx | 2 +- vcl/source/opengl/OpenGLHelper.cxx | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-)
New commits: commit ae177f5b9965684c1a358aa43e5957cff218210b Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Thu Dec 18 10:13:40 2014 +0100 ifix the OpenGL UI config part Change-Id: I931a4b618f35188e4e0cca07305ff15bbbacc20a diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 55222bc9..28e0677 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 7f4cf36..a30b9ef 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 */) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits