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

Unified Diff: src/pdf/SkPDFGraphicState.cpp

Issue 1772493002: SkPDF: AutoTUnref<T> changes in use (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFMetadata.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFGraphicState.cpp
diff --git a/src/pdf/SkPDFGraphicState.cpp b/src/pdf/SkPDFGraphicState.cpp
index 0ad1853f3e9b1e6ed77ffc4a9b9274475a51860c..2bccac0cb94d1c92d69a3c4c79f63b1b33231334 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -139,11 +139,11 @@ static SkPDFObject* create_invert_function() {
SkAutoTUnref<SkData> psInvertStream(
SkData::NewWithoutCopy(psInvert, strlen(psInvert)));
- SkPDFStream* invertFunction = new SkPDFStream(psInvertStream.get());
+ SkAutoTUnref<SkPDFStream> invertFunction(new SkPDFStream(psInvertStream.get()));
invertFunction->insertInt("FunctionType", 4);
invertFunction->insertObject("Domain", SkRef(domainAndRange.get()));
- invertFunction->insertObject("Range", domainAndRange.detach());
- return invertFunction;
+ invertFunction->insertObject("Range", domainAndRange.release());
+ return invertFunction.release();
}
SK_DECLARE_STATIC_ONCE_PTR(SkPDFObject, invertFunction);
@@ -165,9 +165,9 @@ SkPDFDict* SkPDFGraphicState::GetSMaskGraphicState(SkPDFFormXObject* sMask,
sMaskDict->insertObjRef("TR", SkRef(invertFunction.get(create_invert_function)));
}
- SkPDFDict* result = new SkPDFDict("ExtGState");
- result->insertObject("SMask", sMaskDict.detach());
- return result;
+ SkAutoTUnref<SkPDFDict> result(new SkPDFDict("ExtGState"));
+ result->insertObject("SMask", sMaskDict.release());
+ return result.release();
}
static SkPDFDict* create_no_smask_graphic_state() {
« no previous file with comments | « src/pdf/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFMetadata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698