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

Unified Diff: src/pdf/SkPDFResourceDict.cpp

Issue 1775043002: SkPDF: Add sk_sp setters; .release() becomes std::move() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix -Wpessimizing-move 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/SkPDFResourceDict.h ('k') | src/pdf/SkPDFShader.cpp » ('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 d3f4a6d53347d29c36518e0c18cfd105f86cad23..c2144223b462ae45e07ea26eefab42b4377be3b0 100644
--- a/src/pdf/SkPDFResourceDict.cpp
+++ b/src/pdf/SkPDFResourceDict.cpp
@@ -64,12 +64,12 @@ static void add_subdict(
auto resources = sk_make_sp<SkPDFDict>();
for (int i = 0; i < resourceList.count(); i++) {
resources->insertObjRef(SkPDFResourceDict::getResourceName(type, i),
- SkRef(resourceList[i]));
+ sk_sp<SkPDFObject>(SkRef(resourceList[i])));
}
- dst->insertObject(get_resource_type_name(type), resources.release());
+ dst->insertObject(get_resource_type_name(type), std::move(resources));
}
-SkPDFDict* SkPDFResourceDict::Create(
+sk_sp<SkPDFDict> SkPDFResourceDict::Make(
const SkTDArray<SkPDFObject*>* gStateResources,
const SkTDArray<SkPDFObject*>* patternResources,
const SkTDArray<SkPDFObject*>* xObjectResources,
@@ -83,7 +83,7 @@ SkPDFDict* SkPDFResourceDict::Create(
for (size_t i = 0; i < SK_ARRAY_COUNT(kProcs); i++) {
procSets->appendName(kProcs[i]);
}
- dict->insertObject("ProcSets", procSets.release());
+ dict->insertObject("ProcSets", std::move(procSets));
if (gStateResources) {
add_subdict(*gStateResources, kExtGState_ResourceType, dict.get());
@@ -97,5 +97,5 @@ SkPDFDict* SkPDFResourceDict::Create(
if (fontResources) {
add_subdict(*fontResources, kFont_ResourceType, dict.get());
}
- return dict.release();
+ return dict;
}
« no previous file with comments | « src/pdf/SkPDFResourceDict.h ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698