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

Unified Diff: src/pdf/SkPDFBitmap.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 | « no previous file | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFBitmap.cpp
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 3b0d38ce26ff769e8cb19b46fede5fb5aac77c21..29b3bee748917d017b013f66b5a9d1e185975333 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -322,7 +322,7 @@ static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
result->appendInt(0);
char shortTableArray[3] = {0, 0, 0};
SkString tableString(shortTableArray, SK_ARRAY_COUNT(shortTableArray));
- result->append(new SkPDFString(tableString))->unref();
+ result->appendString(tableString);
return result;
}
result->appendInt(table->count() - 1); // maximum color index.
@@ -338,7 +338,7 @@ static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
tablePtr += 3;
}
SkString tableString(tableArray, 3 * table->count());
- result->append(new SkPDFString(tableString))->unref();
+ result->appendString(tableString);
return result;
}
@@ -362,8 +362,8 @@ void PDFDefaultBitmap::emitObject(SkWStream* stream,
pdfDict.insertInt("Height", fBitmap.height());
if (fBitmap.colorType() == kIndex_8_SkColorType) {
SkASSERT(1 == pdf_color_component_count(fBitmap.colorType()));
- pdfDict.insert("ColorSpace", make_indexed_color_space(
- fBitmap.getColorTable()))->unref();
+ pdfDict.insertObject("ColorSpace",
+ make_indexed_color_space(fBitmap.getColorTable()));
} else if (1 == pdf_color_component_count(fBitmap.colorType())) {
pdfDict.insertName("ColorSpace", "DeviceGray");
} else {
@@ -371,7 +371,7 @@ void PDFDefaultBitmap::emitObject(SkWStream* stream,
}
pdfDict.insertInt("BitsPerComponent", 8);
if (fSMask) {
- pdfDict.insert("SMask", new SkPDFObjRef(fSMask))->unref();
+ pdfDict.insertObjRef("SMask", SkRef(fSMask.get()));
}
pdfDict.insertName("Filter", "FlateDecode");
pdfDict.insertInt("Length", asset->getLength());
« no previous file with comments | « no previous file | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698