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

Unified Diff: src/pdf/SkPDFFont.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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/images/SkMovie.cpp ('k') | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFont.cpp
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 08c1289ce361b8f3fa1b3bbf34c0f66badf28547..bdd83efe28129f42b618a7a47c18fedade38a551 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -157,7 +157,7 @@ static SkData* handle_type1_stream(SkStream* srcStream, size_t* headerLen,
// if the data was NUL terminated so that we can use strstr() to search it.
// Make as few copies as possible given these constraints.
SkDynamicMemoryWStream dynamicStream;
- SkAutoTUnref<SkMemoryStream> staticStream;
+ SkAutoTDelete<SkMemoryStream> staticStream;
SkData* data = NULL;
const uint8_t* src;
size_t srcLen;
@@ -585,7 +585,7 @@ static size_t get_subset_font_stream(const char* fontName,
const SkTDArray<uint32_t>& subset,
SkPDFStream** fontStream) {
int ttcIndex;
- SkAutoTUnref<SkStream> fontData(typeface->openStream(&ttcIndex));
+ SkAutoTDelete<SkStream> fontData(typeface->openStream(&ttcIndex));
SkASSERT(fontData.get());
size_t fontSize = fontData->getLength();
@@ -1161,7 +1161,7 @@ bool SkPDFCIDFont::addFontDescriptor(int16_t defaultWidth,
fontStream.reset(rawStream);
} else {
int ttcIndex;
- SkAutoTUnref<SkStream> fontData(
+ SkAutoTDelete<SkStream> fontData(
typeface()->openStream(&ttcIndex));
fontStream.reset(new SkPDFStream(fontData.get()));
fontSize = fontData->getLength();
@@ -1178,7 +1178,7 @@ bool SkPDFCIDFont::addFontDescriptor(int16_t defaultWidth,
case SkAdvancedTypefaceMetrics::kCFF_Font:
case SkAdvancedTypefaceMetrics::kType1CID_Font: {
int ttcIndex;
- SkAutoTUnref<SkStream> fontData(typeface()->openStream(&ttcIndex));
+ SkAutoTDelete<SkStream> fontData(typeface()->openStream(&ttcIndex));
SkAutoTUnref<SkPDFStream> fontStream(
new SkPDFStream(fontData.get()));
addResource(fontStream.get());
@@ -1308,7 +1308,7 @@ bool SkPDFType1Font::addFontDescriptor(int16_t defaultWidth) {
size_t header SK_INIT_TO_AVOID_WARNING;
size_t data SK_INIT_TO_AVOID_WARNING;
size_t trailer SK_INIT_TO_AVOID_WARNING;
- SkAutoTUnref<SkStream> rawFontData(typeface()->openStream(&ttcIndex));
+ SkAutoTDelete<SkStream> rawFontData(typeface()->openStream(&ttcIndex));
SkAutoTUnref<SkData> fontData(handle_type1_stream(rawFontData.get(), &header,
&data, &trailer));
if (fontData.get() == NULL) {
@@ -1475,7 +1475,7 @@ bool SkPDFType3Font::populate(uint16_t glyphID) {
SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(),
&content);
}
- SkAutoTUnref<SkMemoryStream> glyphStream(new SkMemoryStream());
+ SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream());
glyphStream->setData(content.copyToData())->unref();
SkAutoTUnref<SkPDFStream> glyphDescription(
« no previous file with comments | « src/images/SkMovie.cpp ('k') | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698