summaryrefslogtreecommitdiff
path: root/cui/source/options/optgdlg.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-02-07 15:36:26 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-02-10 10:10:01 +0100
commit90b02dd4a465f312a6b9c27ff572b5a304e857de (patch)
treed38338dd6396a564b7e552fbe1cab170e5f924ce /cui/source/options/optgdlg.cxx
parent3081998ada2ad60d14f8b2343309fe79776f898a (diff)
in case of Skia problems force raster mode, don't disable it all
Skia's CPU-based raster mode should be safe (at least from driver problems), so it should be enough to make the failsafe mechanism just disable Vulkan use. Also add UI option controlling forced raster rendering. Change-Id: I6be1745782816e5468e55635ae5613b6a6afded6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88206 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'cui/source/options/optgdlg.cxx')
-rw-r--r--cui/source/options/optgdlg.cxx43
1 files changed, 41 insertions, 2 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index e10f743361c8..fb73341b9897 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -188,6 +188,7 @@ class SkiaCfg
private:
bool mbUseSkia;
bool mbForceSkia;
+ bool mbForceSkiaRaster;
bool mbModified;
public:
@@ -196,9 +197,11 @@ public:
bool useSkia() const;
bool forceSkia() const;
+ bool forceSkiaRaster() const;
void setUseSkia(bool bSkia);
void setForceSkia(bool bSkia);
+ void setForceSkiaRaster(bool bSkia);
void reset();
};
@@ -213,6 +216,7 @@ void SkiaCfg::reset()
{
mbUseSkia = officecfg::Office::Common::VCL::UseSkia::get();
mbForceSkia = officecfg::Office::Common::VCL::ForceSkia::get();
+ mbForceSkiaRaster = officecfg::Office::Common::VCL::ForceSkiaRaster::get();
mbModified = false;
}
@@ -227,6 +231,8 @@ SkiaCfg::~SkiaCfg()
officecfg::Office::Common::VCL::UseSkia::set(mbUseSkia, batch);
if (!officecfg::Office::Common::VCL::ForceSkia::isReadOnly())
officecfg::Office::Common::VCL::ForceSkia::set(mbForceSkia, batch);
+ if (!officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly())
+ officecfg::Office::Common::VCL::ForceSkiaRaster::set(mbForceSkiaRaster, batch);
batch->commit();
}
catch (...)
@@ -245,6 +251,11 @@ bool SkiaCfg::forceSkia() const
return mbForceSkia;
}
+bool SkiaCfg::forceSkiaRaster() const
+{
+ return mbForceSkiaRaster;
+}
+
void SkiaCfg::setUseSkia(bool bSkia)
{
if (bSkia != mbUseSkia)
@@ -263,6 +274,15 @@ void SkiaCfg::setForceSkia(bool bSkia)
}
}
+void SkiaCfg::setForceSkiaRaster(bool bSkia)
+{
+ if (mbForceSkiaRaster != bSkia)
+ {
+ mbForceSkiaRaster = bSkia;
+ mbModified = true;
+ }
+}
+
}
// class OfaMiscTabPage --------------------------------------------------
@@ -759,6 +779,7 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
, m_xForceOpenGL(m_xBuilder->weld_check_button("forceopengl"))
, m_xUseSkia(m_xBuilder->weld_check_button("useskia"))
, m_xForceSkia(m_xBuilder->weld_check_button("forceskia"))
+ , m_xForceSkiaRaster(m_xBuilder->weld_check_button("forceskiaraster"))
, m_xOpenGLStatusEnabled(m_xBuilder->weld_label("openglenabled"))
, m_xOpenGLStatusDisabled(m_xBuilder->weld_label("opengldisabled"))
, m_xSkiaStatusEnabled(m_xBuilder->weld_label("skiaenabled"))
@@ -774,6 +795,7 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
m_xOpenGLStatusDisabled->hide();
m_xUseSkia->hide();
m_xForceSkia->hide();
+ m_xForceSkiaRaster->hide();
m_xSkiaStatusEnabled->hide();
m_xSkiaStatusDisabled->hide();
m_xMenuIconBox->hide();
@@ -791,6 +813,7 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
m_xForceOpenGL->connect_toggled(LINK(this, OfaViewTabPage, OnForceOpenGLToggled));
m_xForceSkia->connect_toggled(LINK(this, OfaViewTabPage, OnForceSkiaToggled));
+ m_xForceSkiaRaster->connect_toggled(LINK(this, OfaViewTabPage, OnForceSkiaRasterToggled));
// Set known icon themes
OUString sAutoStr( m_xIconStyleLB->get_text( 0 ) );
@@ -825,6 +848,8 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
m_xUseSkia->set_sensitive(false);
if (officecfg::Office::Common::VCL::ForceSkia::isReadOnly())
m_xForceSkia->set_sensitive(false);
+ if (officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly())
+ m_xForceSkiaRaster->set_sensitive(false);
UpdateOGLStatus();
UpdateSkiaStatus();
@@ -862,6 +887,15 @@ IMPL_LINK_NOARG(OfaViewTabPage, OnForceSkiaToggled, weld::ToggleButton&, void)
}
}
+IMPL_LINK_NOARG(OfaViewTabPage, OnForceSkiaRasterToggled, weld::ToggleButton&, void)
+{
+ if (m_xForceSkiaRaster->get_active())
+ {
+ // Forcing Skia raster implies that Skia is on.
+ m_xUseSkia->set_active(true);
+ }
+}
+
std::unique_ptr<SfxTabPage> OfaViewTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
{
return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
@@ -1029,10 +1063,12 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
}
if (m_xUseSkia->get_state_changed_from_saved() ||
- m_xForceSkia->get_state_changed_from_saved())
+ m_xForceSkia->get_state_changed_from_saved() ||
+ m_xForceSkiaRaster->get_state_changed_from_saved())
{
mpSkiaConfig->setUseSkia(m_xUseSkia->get_active());
mpSkiaConfig->setForceSkia(m_xForceSkia->get_active());
+ mpSkiaConfig->setForceSkiaRaster(m_xForceSkiaRaster->get_active());
bModified = true;
}
@@ -1074,7 +1110,8 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
}
if (m_xUseSkia->get_state_changed_from_saved() ||
- m_xForceSkia->get_state_changed_from_saved())
+ m_xForceSkia->get_state_changed_from_saved() ||
+ m_xForceSkiaRaster->get_state_changed_from_saved())
{
SolarMutexGuard aGuard;
if( svtools::executeRestartDialog(
@@ -1191,6 +1228,7 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xForceOpenGL->set_active(mpOpenGLConfig->forceOpenGL());
m_xUseSkia->set_active(mpSkiaConfig->useSkia());
m_xForceSkia->set_active(mpSkiaConfig->forceSkia());
+ m_xForceSkiaRaster->set_active(mpSkiaConfig->forceSkiaRaster());
#if defined( UNX )
m_xFontAntiAliasing->save_state();
@@ -1202,6 +1240,7 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xForceOpenGL->save_state();
m_xUseSkia->save_state();
m_xForceSkia->save_state();
+ m_xForceSkiaRaster->save_state();
#if defined( UNX )
OnAntialiasingToggled(*m_xFontAntiAliasing);