summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-15 16:53:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-16 16:57:21 +0200
commitaf8406dd3f43bece257ba9ea2533c8649c3880fe (patch)
treea575933ba07406cccd591933cf3097f4406a829a
parentRemove description from mobile macro selector (diff)
downloadcore-af8406dd3f43bece257ba9ea2533c8649c3880fe.tar.gz
core-af8406dd3f43bece257ba9ea2533c8649c3880fe.zip
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 <caolanm@redhat.com>
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx9
1 files changed, 6 insertions, 3 deletions
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