Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 651723003: Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: safe unref Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/core/SkLazyPtr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 if (!buffer.isValid()) { 91 if (!buffer.isValid()) {
92 return false; 92 return false;
93 } 93 }
94 } 94 }
95 SkRect rect; 95 SkRect rect;
96 buffer.readRect(&rect); 96 buffer.readRect(&rect);
97 if (!buffer.isValid() || !buffer.validate(SkIsValidRect(rect))) { 97 if (!buffer.isValid() || !buffer.validate(SkIsValidRect(rect))) {
98 return false; 98 return false;
99 } 99 }
100 100
101 uint32_t flags = buffer.readUInt(); 101 uint32_t flags = buffer.readUInt();
102 fCropRect = CropRect(rect, flags); 102 fCropRect = CropRect(rect, flags);
103 if (buffer.isVersionLT(SkReadBuffer::kImageFilterUniqueID_Version)) { 103 if (buffer.isVersionLT(SkReadBuffer::kImageFilterUniqueID_Version)) {
104 fUniqueID = next_image_filter_unique_id(); 104 fUniqueID = next_image_filter_unique_id();
105 } else { 105 } else {
106 fUniqueID = buffer.readUInt(); 106 fUniqueID = buffer.readUInt();
107 } 107 }
108 return buffer.isValid(); 108 return buffer.isValid();
109 } 109 }
110 110
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 SkImageFilter::Cache* CreateCache() { 488 SkImageFilter::Cache* CreateCache() {
489 return SkImageFilter::Cache::Create(kDefaultCacheSize); 489 return SkImageFilter::Cache::Create(kDefaultCacheSize);
490 } 490 }
491 491
492 } // namespace 492 } // namespace
493 493
494 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { 494 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
495 return SkNEW_ARGS(CacheImpl, (maxBytes)); 495 return SkNEW_ARGS(CacheImpl, (maxBytes));
496 } 496 }
497 497
498 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
499
498 SkImageFilter::Cache* SkImageFilter::Cache::Get() { 500 SkImageFilter::Cache* SkImageFilter::Cache::Get() {
499 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
500 return cache.get(); 501 return cache.get();
501 } 502 }
OLDNEW
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/core/SkLazyPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698