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

Unified Diff: src/pdf/SkPDFShader.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/SkPDFShader.h ('k') | src/pdf/SkPDFTypes.h » ('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 8d5ee5a753697450285b73851c96e59612a3c324..95ef9dcca0b90215b05fe38e6251cb658665a735 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -771,7 +771,7 @@ SkPDFFunctionShader* SkPDFFunctionShader::Create(
return nullptr;
}
- sk_sp<SkPDFArray> domain(new SkPDFArray);
+ auto domain = sk_make_sp<SkPDFArray>();
domain->reserve(4);
domain->appendScalar(bbox.fLeft);
domain->appendScalar(bbox.fRight);
@@ -799,7 +799,7 @@ SkPDFFunctionShader* SkPDFFunctionShader::Create(
functionCode = codeFunction(*info, perspectiveInverseOnly);
}
- sk_sp<SkPDFDict> pdfShader(new SkPDFDict);
+ auto pdfShader = sk_make_sp<SkPDFDict>();
pdfShader->insertInt("ShadingType", 1);
pdfShader->insertName("ColorSpace", "DeviceRGB");
pdfShader->insertObject("Domain", SkRef(domain.get()));
@@ -808,8 +808,8 @@ SkPDFFunctionShader* SkPDFFunctionShader::Create(
make_ps_function(functionCode, domain.get()));
pdfShader->insertObjRef("Function", function.release());
- sk_sp<SkPDFFunctionShader> pdfFunctionShader(new SkPDFFunctionShader(autoState->detach()));
-
+ sk_sp<SkPDFFunctionShader> pdfFunctionShader(
+ new SkPDFFunctionShader(autoState->detach()));
pdfFunctionShader->insertInt("PatternType", 2);
pdfFunctionShader->insertObject("Matrix",
SkPDFUtils::MatrixToArray(finalMatrix));
« no previous file with comments | « src/pdf/SkPDFShader.h ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698