vcl/inc/unx/gtk/gtkinst.hxx | 2 +- vcl/unx/gtk/gtkinst.cxx | 9 +++++---- vcl/unx/gtk/gtksalframe.cxx | 2 +- vcl/unx/gtk3/gtk3gtkframe.cxx | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-)
New commits: commit 08814a34e3a3841c316dfb27a07583049abc5195 Author: Ashod Nakashian <[email protected]> Date: Sat Jun 2 23:57:04 2018 -0400 vcl: refresh font cache only on real change GTK3 emits way too many style-updated, which triggers font cache updates. The avoidance of unecessary font cache updates was first implemented in 29c55564. Unfortuantely, it seems that the current font-options was never set as last-seen font-options, so still to many fonts-changed were emitted Change-Id: I01a47d4d7fb033e335b1a49ffa6e1bb98f7fd28d Reviewed-on: https://gerrit.libreoffice.org/55287 Tested-by: Jenkins <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 62cf55d20ce3..41ba5675df0b 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -237,7 +237,7 @@ public: virtual const cairo_font_options_t* GetCairoFontOptions() override; const cairo_font_options_t* GetLastSeenCairoFontOptions(); - void ResetLastSeenCairoFontOptions(); + void ResetLastSeenCairoFontOptions(const cairo_font_options_t* pOptions); void RemoveTimer (); diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx index f7c41fff0f7d..42bb9e6e2423 100644 --- a/vcl/unx/gtk/gtkinst.cxx +++ b/vcl/unx/gtk/gtkinst.cxx @@ -194,7 +194,7 @@ GtkInstance::~GtkInstance() { assert( nullptr == m_pTimer ); DeInitAtkBridge(); - ResetLastSeenCairoFontOptions(); + ResetLastSeenCairoFontOptions(nullptr); } SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) @@ -484,13 +484,14 @@ const cairo_font_options_t* GtkInstance::GetLastSeenCairoFontOptions() return m_pLastCairoFontOptions; } -void GtkInstance::ResetLastSeenCairoFontOptions() +void GtkInstance::ResetLastSeenCairoFontOptions(const cairo_font_options_t* pCairoFontOptions) { if (m_pLastCairoFontOptions) - { cairo_font_options_destroy(m_pLastCairoFontOptions); + if (pCairoFontOptions) + m_pLastCairoFontOptions = cairo_font_options_copy(pCairoFontOptions); + else m_pLastCairoFontOptions = nullptr; - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index 3f99b8c30d3d..16e716b16daa 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -3112,7 +3112,7 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram bFontSettingsChanged = false; if (bFontSettingsChanged) { - pInstance->ResetLastSeenCairoFontOptions(); + pInstance->ResetLastSeenCairoFontOptions(pCurrentCairoFontOptions); GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged ); } } diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 38cb6b8c087a..f71e8f5ab344 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -3256,7 +3256,7 @@ void GtkSalFrame::signalStyleUpdated(GtkWidget*, gpointer frame) bFontSettingsChanged = false; if (bFontSettingsChanged) { - pInstance->ResetLastSeenCairoFontOptions(); + pInstance->ResetLastSeenCairoFontOptions(pCurrentCairoFontOptions); GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged ); } } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
