aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-09-01 13:49:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-01 13:49:13 -0700
commitd0634eeb565d706df2e148a33f137c6edf42bf2e (patch)
treecefb5d7f7b18aab3299904594d6995e07b368e47
parent07f0446e9a36e39814a92a1681ab59de79275651 (diff)
Force SkPath::getConvexity() cache for thread safety.
-rw-r--r--src/core/SkLiteDL.cpp5
-rw-r--r--src/core/SkRecords.cpp1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp
index fee6de385c..b88f7bc62c 100644
--- a/src/core/SkLiteDL.cpp
+++ b/src/core/SkLiteDL.cpp
@@ -43,7 +43,10 @@ static D* pod(T* op, size_t offset = 0) {
// Pre-cache lazy non-threadsafe fields on SkPath and/or SkMatrix.
static void make_threadsafe(SkPath* path, SkMatrix* matrix) {
- if (path) { path->updateBoundsCache(); }
+ if (path) {
+ path->updateBoundsCache();
+ (void)path->getConvexity();
+ }
if (matrix) { (void)matrix->getType(); }
}
diff --git a/src/core/SkRecords.cpp b/src/core/SkRecords.cpp
index 81dd92f9ef..555f992369 100644
--- a/src/core/SkRecords.cpp
+++ b/src/core/SkRecords.cpp
@@ -11,6 +11,7 @@
namespace SkRecords {
PreCachedPath::PreCachedPath(const SkPath& path) : SkPath(path) {
this->updateBoundsCache();
+ (void)this->getConvexity();
#if 0 // Disabled to see if we ever really race on this. It costs time, chromium:496982.
SkPathPriv::FirstDirection junk;
(void)SkPathPriv::CheapComputeFirstDirection(*this, &junk);