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

Unified Diff: src/pdf/SkPDFGraphicState.cpp

Issue 1107923002: SkPDF: clean up uses of deprecated calls in other SkPDF classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-27 (Monday) 09:04:15 EDT Created 5 years, 8 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/SkPDFShader.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 04eda5812ad16f7e9981d8266e78a24b519d8674..d063c1505ec4d2d899cad3016ac76e7d867648b5 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -143,8 +143,8 @@ SkPDFObject* create_invert_function() {
SkPDFStream* invertFunction = SkNEW_ARGS(
SkPDFStream, (psInvertStream.get()));
invertFunction->insertInt("FunctionType", 4);
- invertFunction->insert("Domain", domainAndRange.get());
- invertFunction->insert("Range", domainAndRange.get());
+ invertFunction->insertObject("Domain", SkRef(domainAndRange.get()));
+ invertFunction->insertObject("Range", domainAndRange.detach());
return invertFunction;
}
@@ -168,13 +168,13 @@ SkPDFDict* SkPDFGraphicState::GetSMaskGraphicState(SkPDFFormXObject* sMask,
} else if (sMaskMode == kLuminosity_SMaskMode) {
sMaskDict->insertName("S", "Luminosity");
}
- sMaskDict->insert("G", new SkPDFObjRef(sMask))->unref();
+ sMaskDict->insertObjRef("G", SkRef(sMask));
if (invert) {
- sMaskDict->insert("TR", new SkPDFObjRef(invertFunction.get()))->unref();
+ sMaskDict->insertObjRef("TR", SkRef(invertFunction.get()));
}
SkPDFDict* result = new SkPDFDict("ExtGState");
- result->insert("SMask", sMaskDict.get());
+ result->insertObject("SMask", sMaskDict.detach());
return result;
}
@@ -201,9 +201,9 @@ void SkPDFGraphicState::emitObject(SkWStream* stream,
SkAutoTUnref<SkPDFDict> dict(SkNEW_ARGS(SkPDFDict, ("ExtGState")));
dict->insertName("Type", "ExtGState");
- SkAutoTUnref<SkPDFScalar> alpha(new SkPDFScalar(SkScalarDiv(fAlpha, 0xFF)));
- dict->insert("CA", alpha.get());
- dict->insert("ca", alpha.get());
+ SkScalar alpha = SkScalarDiv(fAlpha, 0xFF);
+ dict->insertScalar("CA", alpha);
+ dict->insertScalar("ca", alpha);
SkPaint::Cap strokeCap = (SkPaint::Cap)fStrokeCap;
SkPaint::Join strokeJoin = (SkPaint::Join)fStrokeJoin;
@@ -225,8 +225,7 @@ void SkPDFGraphicState::emitObject(SkWStream* stream,
dict->insertScalar("LW", fStrokeWidth);
dict->insertScalar("ML", fStrokeMiter);
- // SA = Auto stroke adjustment.
- dict->insert("SA", new SkPDFBool(true))->unref();
+ dict->insertBool("SA", true); // SA = Auto stroke adjustment.
dict->insertName("BM", as_blend_mode(xferMode));
dict->emitObject(stream, objNumMap, substitutes);
}
« no previous file with comments | « src/pdf/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698