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

Unified Diff: src/pdf/SkPDFResourceDict.cpp

Issue 1773033002: SkPDF: use sk_make_sp<T> when it makes sense. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-08 (Tuesday) 06:54:33 EST Created 4 years, 9 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/SkPDFMetadata.cpp ('k') | src/pdf/SkPDFShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFResourceDict.cpp
diff --git a/src/pdf/SkPDFResourceDict.cpp b/src/pdf/SkPDFResourceDict.cpp
index 460d18c74077a92182e8934b618c300ac0913f52..d3f4a6d53347d29c36518e0c18cfd105f86cad23 100644
--- a/src/pdf/SkPDFResourceDict.cpp
+++ b/src/pdf/SkPDFResourceDict.cpp
@@ -61,7 +61,7 @@ static void add_subdict(
if (0 == resourceList.count()) {
return;
}
- sk_sp<SkPDFDict> resources(new SkPDFDict);
+ auto resources = sk_make_sp<SkPDFDict>();
for (int i = 0; i < resourceList.count(); i++) {
resources->insertObjRef(SkPDFResourceDict::getResourceName(type, i),
SkRef(resourceList[i]));
@@ -74,10 +74,10 @@ SkPDFDict* SkPDFResourceDict::Create(
const SkTDArray<SkPDFObject*>* patternResources,
const SkTDArray<SkPDFObject*>* xObjectResources,
const SkTDArray<SkPDFObject*>* fontResources) {
- sk_sp<SkPDFDict> dict(new SkPDFDict);
+ auto dict = sk_make_sp<SkPDFDict>();
static const char kProcs[][7] = {
"PDF", "Text", "ImageB", "ImageC", "ImageI"};
- sk_sp<SkPDFArray> procSets(new SkPDFArray);
+ auto procSets = sk_make_sp<SkPDFArray>();
procSets->reserve(SK_ARRAY_COUNT(kProcs));
for (size_t i = 0; i < SK_ARRAY_COUNT(kProcs); i++) {
« no previous file with comments | « src/pdf/SkPDFMetadata.cpp ('k') | src/pdf/SkPDFShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698