Kaydet (Commit) ae177f5b authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

ifix the OpenGL UI config part

Change-Id: I931a4b618f35188e4e0cca07305ff15bbbacc20a
üst 146bd125
...@@ -146,7 +146,7 @@ OpenGLCfg::~OpenGLCfg() ...@@ -146,7 +146,7 @@ OpenGLCfg::~OpenGLCfg()
boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
officecfg::Office::Common::VCL::UseOpenGL::set(mbUseOpenGL, batch); officecfg::Office::Common::VCL::UseOpenGL::set(mbUseOpenGL, batch);
officecfg::Office::Common::VCL::ForceOpenGL::set(mbForceOpenGL, batch); officecfg::Office::Common::VCL::ForceOpenGL::set(mbForceOpenGL, batch);
batch->commit();
} }
} }
......
...@@ -401,6 +401,17 @@ bool OpenGLHelper::supportsVCLOpenGL() ...@@ -401,6 +401,17 @@ bool OpenGLHelper::supportsVCLOpenGL()
bool OpenGLHelper::isVCLOpenGLEnabled() 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: * There are a number of cases that these environment variables cover:
* * SAL_FORCEGL forces OpenGL independent of any other option * * SAL_FORCEGL forces OpenGL independent of any other option
...@@ -408,16 +419,20 @@ bool OpenGLHelper::isVCLOpenGLEnabled() ...@@ -408,16 +419,20 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
* * SAL_ENABLEGL overrides VCL_HIDE_WINDOWS and the configuration variable * * SAL_ENABLEGL overrides VCL_HIDE_WINDOWS and the configuration variable
* * the configuration variable is checked if no environment variable is set * * 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) if (bForceOpenGL)
return true; return true;
if (!supportsVCLOpenGL()) if (!supportsVCLOpenGL())
{
return false; return false;
}
static bool bEnableGLEnv = !!getenv("SAL_ENABLEGL"); static bool bEnableGLEnv = !!getenv("SAL_ENABLEGL");
bool bEnable = bEnableGLEnv; bEnable = bEnableGLEnv;
static bool bDuringBuild = getenv("VCL_HIDE_WINDOWS"); static bool bDuringBuild = getenv("VCL_HIDE_WINDOWS");
if (bDuringBuild && !bEnable /* env. enable overrides */) if (bDuringBuild && !bEnable /* env. enable overrides */)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment