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

Unified Diff: src/pdf/SkPDFShader.cpp

Issue 1334523002: Revert of Port uses of SkLazyPtr to SkOncePtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/utils/SkEventTracer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFShader.cpp
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index fe6e47c1db0f049307969097919a9426c72788c8..645091dad2fe33b3d82a84fe8a728d37232989c4 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -10,7 +10,6 @@
#include "SkPDFShader.h"
#include "SkData.h"
-#include "SkOncePtr.h"
#include "SkPDFCanon.h"
#include "SkPDFDevice.h"
#include "SkPDFFormXObject.h"
@@ -678,7 +677,8 @@
return true;
}
-static SkPDFObject* create_range_object() {
+namespace {
+SkPDFObject* create_range_object() {
SkPDFArray* range = new SkPDFArray;
range->reserve(6);
range->appendInt(0);
@@ -689,7 +689,12 @@
range->appendInt(1);
return range;
}
-SK_DECLARE_STATIC_ONCE_PTR(SkPDFObject, rangeObject);
+
+template <typename T> void unref(T* ptr) { ptr->unref();}
+} // namespace
+
+SK_DECLARE_STATIC_LAZY_PTR(SkPDFObject, rangeObject,
+ create_range_object, unref<SkPDFObject>);
static SkPDFStream* make_ps_function(const SkString& psCode,
SkPDFArray* domain) {
@@ -698,7 +703,7 @@
SkPDFStream* result = new SkPDFStream(funcData.get());
result->insertInt("FunctionType", 4);
result->insertObject("Domain", SkRef(domain));
- result->insertObject("Range", SkRef(rangeObject.get(create_range_object)));
+ result->insertObject("Range", SkRef(rangeObject.get()));
return result;
}
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/utils/SkEventTracer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698