[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - cui/source vcl/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sun Dec 21 07:56:52 PST 2014
cui/source/options/optgdlg.cxx | 2 +-
vcl/source/opengl/OpenGLHelper.cxx | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
New commits:
commit f1252d8c24a59833596c17fed1ef6320d2e72609
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Thu Dec 18 10:13:40 2014 +0100
ifix the OpenGL UI config part
Change-Id: I931a4b618f35188e4e0cca07305ff15bbbacc20a
Reviewed-on: https://gerrit.libreoffice.org/13520
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ffe4bda..842e453 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 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 */)
More information about the Libreoffice-commits
mailing list