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

Unified Diff: src/pdf/SkPDFFont.cpp

Issue 1837553002: SkPDF s/SkAutoTDelete/std::unique_ptr/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-28 (Monday) 10:22:50 EDT 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/SkPDFDocument.cpp ('k') | src/pdf/SkPDFMetadata.h » ('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 cc84a67f7099f1a3a1d0a5c16194d5ceb9ab8577..c42092c09d0d47ef2c919e9bcf5f0466bd5d574d 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -162,7 +162,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;
- SkAutoTDelete<SkMemoryStream> staticStream;
+ std::unique_ptr<SkMemoryStream> staticStream;
SkData* data = nullptr;
const uint8_t* src;
size_t srcLen;
@@ -589,7 +589,7 @@ static size_t get_subset_font_stream(const char* fontName,
const SkTDArray<uint32_t>& subset,
SkPDFStream** fontStream) {
int ttcIndex;
- SkAutoTDelete<SkStream> fontData(typeface->openStream(&ttcIndex));
+ std::unique_ptr<SkStream> fontData(typeface->openStream(&ttcIndex));
SkASSERT(fontData.get());
size_t fontSize = fontData->getLength();
@@ -1056,7 +1056,7 @@ bool SkPDFCIDFont::addFontDescriptor(int16_t defaultWidth,
}
#endif
sk_sp<SkPDFSharedStream> fontStream;
- SkAutoTDelete<SkStreamAsset> fontData(
+ std::unique_ptr<SkStreamAsset> fontData(
this->typeface()->openStream(nullptr));
SkASSERT(fontData);
fontSize = fontData->getLength();
@@ -1198,7 +1198,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;
- SkAutoTDelete<SkStream> rawFontData(typeface()->openStream(&ttcIndex));
+ std::unique_ptr<SkStream> rawFontData(typeface()->openStream(&ttcIndex));
sk_sp<SkData> fontData(handle_type1_stream(rawFontData.get(), &header,
&data, &trailer));
if (fontData.get() == nullptr) {
@@ -1357,7 +1357,7 @@ bool SkPDFType3Font::populate(uint16_t glyphID) {
SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(),
&content);
}
- SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream());
+ std::unique_ptr<SkMemoryStream> glyphStream(new SkMemoryStream());
glyphStream->setData(content.copyToData())->unref();
charProcs->insertObjRef(
« no previous file with comments | « src/pdf/SkPDFDocument.cpp ('k') | src/pdf/SkPDFMetadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698