vcl/unx/generic/gdi/salgdi.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit af8406dd3f43bece257ba9ea2533c8649c3880fe
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Apr 15 16:53:51 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Apr 16 16:57:21 2021 +0200

    X11SalGraphics::SupportsCairo is pretty slow and its value won't change
    
    seen in tdf#140639 with
    
    
https://wiki.documentfoundation.org/Development/How_to_debug#Performance_debugging_.28perf.29
    perf record --call-graph dwarf,65528 --pid=`pidof soffice.bin`
    perf script | ~/git/FlameGraph/stackcollapse-perf.pl | 
~/git/FlameGraph/flamegraph.pl --width 4096 --height 24 > perf.svg
    
    Change-Id: Ibb3b2bdd57adcabf74f38c35878cf2c00e1e5de0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114161
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index ef99f1d4274e..62a47b074d2f 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -498,9 +498,12 @@ void X11SalGraphics::Flush()
 
 bool X11SalGraphics::SupportsCairo() const
 {
-    Display *pDisplay = GetXDisplay();
-    int nDummy;
-    return XQueryExtension(pDisplay, "RENDER", &nDummy, &nDummy, &nDummy);
+    static bool bSupportsCairo = [this] {
+        Display *pDisplay = GetXDisplay();
+        int nDummy;
+        return XQueryExtension(pDisplay, "RENDER", &nDummy, &nDummy, &nDummy);
+    }();
+    return bSupportsCairo;
 }
 
 cairo::SurfaceSharedPtr X11SalGraphics::CreateSurface(const 
cairo::CairoSurfaceSharedPtr& rSurface) const
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to