diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-15 16:53:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-16 16:57:21 +0200 |
commit | af8406dd3f43bece257ba9ea2533c8649c3880fe (patch) | |
tree | a575933ba07406cccd591933cf3097f4406a829a /vcl | |
parent | 8a994d8f8246b913143c1062f970e045d9105c61 (diff) |
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>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 9 |
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 |