summaryrefslogtreecommitdiff
path: root/cui
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
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')
-rw-r--r--cui/source/options/optgdlg.cxx43
-rw-r--r--cui/source/options/optgdlg.hxx2
-rw-r--r--cui/uiconfig/ui/optviewpage.ui21
3 files changed, 62 insertions, 4 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);
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 491b817c25a6..04988f8e57a4 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -117,6 +117,7 @@ private:
std::unique_ptr<weld::CheckButton> m_xForceOpenGL;
std::unique_ptr<weld::CheckButton> m_xUseSkia;
std::unique_ptr<weld::CheckButton> m_xForceSkia;
+ std::unique_ptr<weld::CheckButton> m_xForceSkiaRaster;
std::unique_ptr<weld::Label> m_xOpenGLStatusEnabled;
std::unique_ptr<weld::Label> m_xOpenGLStatusDisabled;
@@ -131,6 +132,7 @@ private:
#endif
DECL_LINK(OnForceOpenGLToggled, weld::ToggleButton&, void);
DECL_LINK(OnForceSkiaToggled, weld::ToggleButton&, void);
+ DECL_LINK(OnForceSkiaRasterToggled, weld::ToggleButton&, void);
void UpdateOGLStatus();
void UpdateSkiaStatus();
diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index 23fd4c4ee63e..a54e5865f7b2 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -599,6 +599,23 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="forceskiaraster">
+ <property name="label" translatable="yes" context="optviewpage|forceskiaraster">Force Skia software rendering</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes" context="optviewpage|forceskia|tooltip_text">Requires restart. Enabling this will prevent the use of graphics drivers.</property>
+ <property name="margin_left">12</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="skiaenabled">
<property name="can_focus">False</property>
<property name="margin_left">12</property>
@@ -607,7 +624,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="top_attach">9</property>
</packing>
</child>
<child>
@@ -619,7 +636,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="top_attach">10</property>
</packing>
</child>
</object>