[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 3 commits - cui/source officecfg/registry vcl/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Wed Dec 17 13:50:51 PST 2014
cui/source/options/optgdlg.cxx | 84 +++++++++++++
cui/source/options/optgdlg.hxx | 7 +
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 8 +
vcl/source/opengl/OpenGLHelper.cxx | 2
4 files changed, 100 insertions(+), 1 deletion(-)
New commits:
commit de388c4b05226e17eeb4da192c7cdb03ee6ec80c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Dec 17 22:29:21 2014 +0100
after resetting the values are not modified
Change-Id: I0211c9c7dcc24ce40fe7c573f35ac13c02e742c1
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index fb8919f..ffe4bda 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -135,6 +135,7 @@ void OpenGLCfg::reset()
{
mbUseOpenGL = officecfg::Office::Common::VCL::UseOpenGL::get();
mbForceOpenGL = officecfg::Office::Common::VCL::ForceOpenGL::get();
+ mbModified = false;
}
OpenGLCfg::~OpenGLCfg()
commit a687def5369aa3ede069f97d24cd5ee75b778251
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Dec 17 22:27:54 2014 +0100
make use of the new ForceOpenGL config variable
Change-Id: Ifdfcbd9d3d62d2a55e3e050d4723700f8436e57a
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 3c08c03..7f4cf36 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -408,7 +408,7 @@ 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");
+ static bool bForceOpenGL = !!getenv("SAL_FORCEGL") || officecfg::Office::Common::VCL::ForceOpenGL::get();
if (bForceOpenGL)
return true;
commit a87991a36587f4d86ea87a0389749409cc1982b7
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Dec 17 22:25:45 2014 +0100
implement the ui part for the OpenGL config variables
Change-Id: I46e2de444d38f1f93eb68ffd50b7a283d05d1738
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index d66fc74..fb8919f 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -68,6 +68,7 @@
#include <unotools/searchopt.hxx>
#include <sal/macros.h>
#include <officecfg/Office/Common.hxx>
+#include <comphelper/configuration.hxx>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -102,6 +103,81 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
using namespace ::utl;
+namespace svt {
+
+class OpenGLCfg
+{
+private:
+ bool mbUseOpenGL;
+ bool mbForceOpenGL;
+ bool mbModified;
+
+public:
+ OpenGLCfg();
+ ~OpenGLCfg();
+
+ bool useOpenGL() const;
+ bool forceOpenGL() const;
+
+ void setUseOpenGL(bool bOpenGL);
+ void setForceOpenGL(bool bOpenGL);
+
+ void reset();
+};
+
+OpenGLCfg::OpenGLCfg():
+ mbModified(false)
+{
+ reset();
+}
+
+void OpenGLCfg::reset()
+{
+ mbUseOpenGL = officecfg::Office::Common::VCL::UseOpenGL::get();
+ mbForceOpenGL = officecfg::Office::Common::VCL::ForceOpenGL::get();
+}
+
+OpenGLCfg::~OpenGLCfg()
+{
+ if (mbModified)
+ {
+ 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);
+
+ }
+}
+
+bool OpenGLCfg::useOpenGL() const
+{
+ return mbUseOpenGL;
+}
+
+bool OpenGLCfg::forceOpenGL() const
+{
+ return mbForceOpenGL;
+}
+
+void OpenGLCfg::setUseOpenGL(bool bOpenGL)
+{
+ if (bOpenGL != mbUseOpenGL)
+ {
+ mbUseOpenGL = bOpenGL;
+ mbModified = true;
+ }
+}
+
+void OpenGLCfg::setForceOpenGL(bool bOpenGL)
+{
+ if (mbForceOpenGL != bOpenGL)
+ {
+ mbForceOpenGL = bOpenGL;
+ mbModified = true;
+ }
+}
+
+}
+
// class OfaMiscTabPage --------------------------------------------------
int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
@@ -556,6 +632,7 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
, pAppearanceCfg(new SvtTabAppearanceCfg)
, pCanvasSettings(new CanvasSettings)
, mpDrawinglayerOpt(new SvtOptionsDrawinglayer)
+ , mpOpenGLConfig(new svt::OpenGLCfg)
{
get(m_pWindowSizeMF, "windowsize");
get(m_pIconSizeLB, "iconsize");
@@ -803,6 +880,9 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
}
}
+ mpOpenGLConfig->setUseOpenGL(m_pUseOpenGL->IsChecked());
+ mpOpenGLConfig->setForceOpenGL(m_pForceOpenGL->IsChecked());
+
// #i97672#
if(m_pSelectionCB->IsEnabled())
{
@@ -870,6 +950,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
void OfaViewTabPage::Reset( const SfxItemSet* )
{
SvtMiscOptions aMiscOptions;
+ mpOpenGLConfig->reset();
if( aMiscOptions.GetSymbolsSize() != SFX_SYMBOLS_SIZE_AUTO )
nSizeLB_InitialSelection = ( aMiscOptions.AreCurrentSymbolsLarge() )? 2 : 1;
@@ -945,6 +1026,8 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_pUseAntiAliase->SaveValue();
}
+ m_pUseOpenGL->Check(mpOpenGLConfig->useOpenGL());
+ m_pForceOpenGL->Check(mpOpenGLConfig->forceOpenGL());
{
// #i97672# Selection
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 18e4297..8e4aee7 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -25,6 +25,8 @@
#include <sfx2/tabdlg.hxx>
#include <svx/langbox.hxx>
+#include <boost/scoped_ptr.hpp>
+
// predeclarations
class CanvasSettings;
class SvtOptionsDrawinglayer;
@@ -32,6 +34,10 @@ namespace vcl {
class IconThemeInfo;
}
+namespace svt {
+ class OpenGLCfg;
+}
+
// class OfaMiscTabPage --------------------------------------------------
class OfaMiscTabPage : public SfxTabPage
@@ -114,6 +120,7 @@ private:
SvtTabAppearanceCfg* pAppearanceCfg;
CanvasSettings* pCanvasSettings;
SvtOptionsDrawinglayer* mpDrawinglayerOpt;
+ boost::scoped_ptr<svt::OpenGLCfg> mpOpenGLConfig;
std::vector<vcl::IconThemeInfo> mInstalledIconThemes;
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 957fa0f..9677a96 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -858,6 +858,14 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="ForceOpenGL" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Specifies if OpenGL rendering should be used in VCL backends
+ supporting it. This one forces the use of OpenGL even if the
+ blacklist would block the OpenGL driver.</desc>
+ </info>
+ <value>false</value>
+ </prop>
</group>
<group oor:name="InternalMSExport">
<info>
More information about the Libreoffice-commits
mailing list