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

Unified Diff: src/pdf/SkPDFShader.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/SkPDFGraphicState.cpp ('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 be9798f850315a073ddb655d1900086af28597a7..cf4188123a8fd28d9a243fb1b2ee9998160ae212 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -601,12 +601,12 @@ static void populate_tiling_pattern_dict(SkPDFDict* pattern,
pattern->insertInt("PatternType", kTiling_PatternType);
pattern->insertInt("PaintType", kColoredTilingPattern_PaintType);
pattern->insertInt("TilingType", kConstantSpacing_TilingType);
- pattern->insert("BBox", SkPDFUtils::RectToArray(bbox))->unref();
+ pattern->insertObject("BBox", SkPDFUtils::RectToArray(bbox));
pattern->insertScalar("XStep", bbox.width());
pattern->insertScalar("YStep", bbox.height());
- pattern->insert("Resources", resources);
+ pattern->insertObject("Resources", SkRef(resources));
if (!matrix.isIdentity()) {
- pattern->insert("Matrix", SkPDFUtils::MatrixToArray(matrix))->unref();
+ pattern->insertObject("Matrix", SkPDFUtils::MatrixToArray(matrix));
}
}
@@ -755,8 +755,8 @@ static SkPDFStream* make_ps_function(const SkString& psCode,
SkData::NewWithCopy(psCode.c_str(), psCode.size()));
SkPDFStream* result = SkNEW_ARGS(SkPDFStream, (funcData.get()));
result->insertInt("FunctionType", 4);
- result->insert("Domain", domain);
- result->insert("Range", rangeObject.get());
+ result->insertObject("Domain", SkRef(domain));
+ result->insertObject("Range", SkRef(rangeObject.get()));
return result;
}
@@ -871,21 +871,19 @@ SkPDFFunctionShader* SkPDFFunctionShader::Create(
SkAutoTUnref<SkPDFDict> pdfShader(new SkPDFDict);
pdfShader->insertInt("ShadingType", 1);
pdfShader->insertName("ColorSpace", "DeviceRGB");
- pdfShader->insert("Domain", domain.get());
+ pdfShader->insertObject("Domain", SkRef(domain.get()));
SkAutoTUnref<SkPDFStream> function(
make_ps_function(functionCode, domain.get()));
- pdfShader->insert("Function", new SkPDFObjRef(function))->unref();
-
- SkAutoTUnref<SkPDFArray> matrixArray(
- SkPDFUtils::MatrixToArray(finalMatrix));
+ pdfShader->insertObjRef("Function", function.detach());
SkPDFFunctionShader* pdfFunctionShader =
SkNEW_ARGS(SkPDFFunctionShader, (autoState->detach()));
pdfFunctionShader->insertInt("PatternType", 2);
- pdfFunctionShader->insert("Matrix", matrixArray.get());
- pdfFunctionShader->insert("Shading", pdfShader.get());
+ pdfFunctionShader->insertObject("Matrix",
+ SkPDFUtils::MatrixToArray(finalMatrix));
+ pdfFunctionShader->insertObject("Shading", pdfShader.detach());
canon->addFunctionShader(pdfFunctionShader);
return pdfFunctionShader;
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698