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

Unified Diff: src/pdf/SkPDFGraphicState.cpp

Issue 1771073002: SkPDF: s/SkAutoTUnref/sk_sp/g (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 2bccac0cb94d1c92d69a3c4c79f63b1b33231334..121e583487e38d45fa087aaf2c5f6908d3e26dea 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -129,17 +129,17 @@ SkPDFGraphicState* SkPDFGraphicState::GetGraphicStateForPaint(
static SkPDFObject* create_invert_function() {
// Acrobat crashes if we use a type 0 function, kpdf crashes if we use
// a type 2 function, so we use a type 4 function.
- SkAutoTUnref<SkPDFArray> domainAndRange(new SkPDFArray);
+ sk_sp<SkPDFArray> domainAndRange(new SkPDFArray);
domainAndRange->reserve(2);
domainAndRange->appendInt(0);
domainAndRange->appendInt(1);
static const char psInvert[] = "{1 exch sub}";
// Do not copy the trailing '\0' into the SkData.
- SkAutoTUnref<SkData> psInvertStream(
+ sk_sp<SkData> psInvertStream(
SkData::NewWithoutCopy(psInvert, strlen(psInvert)));
- SkAutoTUnref<SkPDFStream> invertFunction(new SkPDFStream(psInvertStream.get()));
+ sk_sp<SkPDFStream> invertFunction(new SkPDFStream(psInvertStream.get()));
invertFunction->insertInt("FunctionType", 4);
invertFunction->insertObject("Domain", SkRef(domainAndRange.get()));
invertFunction->insertObject("Range", domainAndRange.release());
@@ -154,7 +154,7 @@ SkPDFDict* SkPDFGraphicState::GetSMaskGraphicState(SkPDFFormXObject* sMask,
SkPDFSMaskMode sMaskMode) {
// The practical chances of using the same mask more than once are unlikely
// enough that it's not worth canonicalizing.
- SkAutoTUnref<SkPDFDict> sMaskDict(new SkPDFDict("Mask"));
+ sk_sp<SkPDFDict> sMaskDict(new SkPDFDict("Mask"));
if (sMaskMode == kAlpha_SMaskMode) {
sMaskDict->insertName("S", "Alpha");
} else if (sMaskMode == kLuminosity_SMaskMode) {
@@ -165,7 +165,7 @@ SkPDFDict* SkPDFGraphicState::GetSMaskGraphicState(SkPDFFormXObject* sMask,
sMaskDict->insertObjRef("TR", SkRef(invertFunction.get(create_invert_function)));
}
- SkAutoTUnref<SkPDFDict> result(new SkPDFDict("ExtGState"));
+ sk_sp<SkPDFDict> result(new SkPDFDict("ExtGState"));
result->insertObject("SMask", sMaskDict.release());
return result.release();
}
@@ -186,7 +186,7 @@ void SkPDFGraphicState::emitObject(
SkWStream* stream,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& substitutes) const {
- SkAutoTUnref<SkPDFDict> dict(new SkPDFDict("ExtGState"));
+ sk_sp<SkPDFDict> dict(new SkPDFDict("ExtGState"));
dict->insertName("Type", "ExtGState");
SkScalar alpha = SkIntToScalar(fAlpha) / 0xFF;
« 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