summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-09-10 20:20:25 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-09-29 09:56:49 +0200
commit7c1dc527837a65b77f7624e18a575271cb46afba (patch)
treeeee754b55fee05621d5a743dbc38ffe6382c2770 /vcl
parent2fb4bb03b4c2ee4f28f3b9e755ee2298d42ac8b9 (diff)
ensure SolarMutex is held for SkiaZone
This is simply being lazy and requiring the mutex held for all Skia operations. With the effort to verify things it'd presumably be possible to make the code thread-safe. Change-Id: I748dbf2d5af66dcd140b5a9d6d57e9d848babf0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103564 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/skia/zone.hxx3
-rw-r--r--vcl/skia/README9
2 files changed, 12 insertions, 0 deletions
diff --git a/vcl/inc/skia/zone.hxx b/vcl/inc/skia/zone.hxx
index 1f6bbb0dddca..6d503e7eb803 100644
--- a/vcl/inc/skia/zone.hxx
+++ b/vcl/inc/skia/zone.hxx
@@ -14,10 +14,13 @@
#include <vcl/dllapi.h>
+#include <comphelper/solarmutex.hxx>
+
// Used around calls to Skia code to detect crashes in drivers.
class VCL_DLLPUBLIC SkiaZone : public CrashZone<SkiaZone>
{
public:
+ SkiaZone() { assert(comphelper::SolarMutex::get()->IsCurrentThread()); }
static void hardDisable();
static void relaxWatchdogTimings();
static const CrashWatchdogTimingsValues& getCrashWatchdogTimingsValues();
diff --git a/vcl/skia/README b/vcl/skia/README
index f178ef8f3b76..c508beb33cea 100644
--- a/vcl/skia/README
+++ b/vcl/skia/README
@@ -59,6 +59,15 @@ You can also use 'visualbackendtest' to visually check some operations. Use some
SAL_SKIA=raster SAL_ENABLESKIA=1 SAL_USE_VCLPLUGIN=gen [srcdir]/bin/run visualbackendtest
+Thread safety:
+==============
+
+SolarMutex must be held for most operations (asserted in SkiaSalGraphicsImpl::preDraw() and
+in SkiaZone constructor). The reason for this is that this restriction does not appear to be
+a problem, so there's no need to verify thread safety of the code (including the Skia library).
+There's probably no fundamental reason why the code couldn't be made thread-safe.
+
+
GrDirectContext sharing:
========================