aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-10-13 13:17:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-13 13:17:56 -0700
commit148ec59001ca7d7e54aec580a048c6dd2a085991 (patch)
treeee310a6be5a0b53ac4ed05dd6907bd0d328dda6d /src/core/SkImageFilter.cpp
parent70242ace3b2ed06b33ee5ea5c9ac3aedea89b194 (diff)
Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope.
Function- or method- local scope isn't threadsafe; the pointer is generally zero-initialized on first use in function scope (i.e. lazily... we have to go deeper), but for globals we can be pretty sure the linker will do that for us. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/651723003
Diffstat (limited to 'src/core/SkImageFilter.cpp')
-rw-r--r--src/core/SkImageFilter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 6f7762ac46..c431ece947 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -97,7 +97,7 @@ bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) {
if (!buffer.isValid() || !buffer.validate(SkIsValidRect(rect))) {
return false;
}
-
+
uint32_t flags = buffer.readUInt();
fCropRect = CropRect(rect, flags);
if (buffer.isVersionLT(SkReadBuffer::kImageFilterUniqueID_Version)) {
@@ -495,7 +495,8 @@ SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
return SkNEW_ARGS(CacheImpl, (maxBytes));
}
+SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
+
SkImageFilter::Cache* SkImageFilter::Cache::Get() {
- SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
return cache.get();
}