summaryrefslogtreecommitdiff
path: root/cui/source/options
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-11-24 12:41:08 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-11-25 14:21:03 +0100
commitfeafba7cc94247f45a82ee4f82f1b0a5f2f61656 (patch)
tree0c5c5993bca7d0ba7bec0fbbedeb81ebbca88eee /cui/source/options
parente41ca15fd67581dbf69322e6a18595d00ab7a151 (diff)
clean up enabling/disabling GUI options related to Skia
This should properly enable/disable 'force Skia software rendering' and 'use hardware acceleration' checkboxes when Skia is enabled or disabled. Technically the two options are duplicates, since 'use hardware acceleration' is the exact opposite of 'force Skia software rendering'. But the implementation of the hw accel option is so tied to the implementation of the canvas module that it's simpler to ignore it for Skia. Change-Id: Ia7c54140aec72d6ef75b7ba53ce83037311f0caf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106491 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'cui/source/options')
-rw-r--r--cui/source/options/optgdlg.cxx47
-rw-r--r--cui/source/options/optgdlg.hxx1
2 files changed, 27 insertions, 21 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 6b71b125e078..0dc33f2c64ba 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -551,11 +551,6 @@ CanvasSettings::CanvasSettings() :
bool CanvasSettings::IsHardwareAccelerationAvailable() const
{
- if (SkiaHelper::isVCLSkiaEnabled() && Application::GetToolkitName() != "gtk3")
- {
- mbHWAccelAvailable = false;
- return false;
- }
#if HAVE_FEATURE_OPENGL
if (OpenGLWrapper::isVCLOpenGLEnabled() && Application::GetToolkitName() != "gtk3")
{
@@ -716,8 +711,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
m_xMoreIcons->set_from_icon_name("cmd/sc_additionsdialog.png");
m_xMoreIcons->connect_clicked(LINK(this, OfaViewTabPage, OnMoreIconsClick));
-
- UpdateSkiaStatus();
}
OfaViewTabPage::~OfaViewTabPage()
@@ -779,6 +772,10 @@ void OfaViewTabPage::UpdateSkiaStatus()
// FIXME: should really add code to show a 'lock' icon here.
m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
m_xForceSkiaRaster->set_sensitive(m_xUseSkia->get_active() && !officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly());
+
+ // Technically the 'use hardware acceleration' option could be used to mean !forceSkiaRaster, but the implementation
+ // of the option is so tied to the implementation of the canvas module that it's simpler to ignore it.
+ UpdateHardwareAccelStatus();
#else
HideSkiaWidgets();
#endif
@@ -1058,20 +1055,8 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xContextMenuShortcutsLB->set_active(bContextMenuShortcutsNonDefault ? eContextMenuShortcuts + 1 : 0);
m_xContextMenuShortcutsLB->save_value();
- { // #i95644# HW accel (unified to disable mechanism)
- if(pCanvasSettings->IsHardwareAccelerationAvailable())
- {
- m_xUseHardwareAccell->set_active(pCanvasSettings->IsHardwareAccelerationEnabled());
- m_xUseHardwareAccell->set_sensitive(!pCanvasSettings->IsHardwareAccelerationRO());
- }
- else
- {
- m_xUseHardwareAccell->set_active(false);
- m_xUseHardwareAccell->set_sensitive(false);
- }
-
- m_xUseHardwareAccell->save_state();
- }
+ UpdateHardwareAccelStatus();
+ m_xUseHardwareAccell->save_state();
{ // #i95644# AntiAliasing
if(mpDrawinglayerOpt->IsAAPossibleOnThisSystem())
@@ -1086,6 +1071,7 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xUseAntiAliase->save_state();
}
+
m_xUseSkia->set_active(mpSkiaConfig->useSkia());
m_xForceSkiaRaster->set_active(mpSkiaConfig->forceSkiaRaster());
@@ -1097,6 +1083,25 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xForceSkiaRaster->save_state();
OnAntialiasingToggled(*m_xFontAntiAliasing);
+ UpdateSkiaStatus();
+}
+
+void OfaViewTabPage::UpdateHardwareAccelStatus()
+{
+ // #i95644# HW accel (unified to disable mechanism)
+ if(pCanvasSettings->IsHardwareAccelerationAvailable())
+ {
+ m_xUseHardwareAccell->set_active(pCanvasSettings->IsHardwareAccelerationEnabled());
+ m_xUseHardwareAccell->set_sensitive(!pCanvasSettings->IsHardwareAccelerationRO());
+ }
+ else
+ {
+ m_xUseHardwareAccell->set_active(false);
+ m_xUseHardwareAccell->set_sensitive(false);
+ }
+#if HAVE_FEATURE_SKIA
+ m_xUseHardwareAccell->set_sensitive(!m_xUseSkia->get_active());
+#endif
}
struct LanguageConfig_Impl
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 93dc5280b98e..0944bb674932 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -125,6 +125,7 @@ private:
DECL_STATIC_LINK(OfaViewTabPage, OnMoreIconsClick, weld::Button&, void);
void UpdateSkiaStatus();
void HideSkiaWidgets();
+ void UpdateHardwareAccelStatus();
public:
OfaViewTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);