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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 23621005: Replace SkTScopedPtr with SkAutoTDelete in Skia. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: port class comment Created 7 years, 4 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/core/SkAdvancedTypefaceMetrics.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index a24c4ecd8ae6373bb1a325d2c377d897f6395397..26b211c89bd3c7d6a7afe669a710925b383f48dc 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -580,14 +580,14 @@ SkDevice* SkPDFDevice::onCreateCompatibleDevice(SkBitmap::Config config,
struct ContentEntry {
GraphicStateEntry fState;
SkDynamicMemoryWStream fContent;
- SkTScopedPtr<ContentEntry> fNext;
+ SkAutoTDelete<ContentEntry> fNext;
// If the stack is too deep we could get Stack Overflow.
// So we manually destruct the object.
~ContentEntry() {
- ContentEntry* val = fNext.release();
+ ContentEntry* val = fNext.detach();
while (val != NULL) {
- ContentEntry* valNext = val->fNext.release();
+ ContentEntry* valNext = val->fNext.detach();
// When the destructor is called, fNext is NULL and exits.
delete val;
val = valNext;
@@ -715,12 +715,12 @@ SkPDFDevice::~SkPDFDevice() {
void SkPDFDevice::init() {
fAnnotations = NULL;
fResourceDict = NULL;
- fContentEntries.reset();
+ fContentEntries.free();
fLastContentEntry = NULL;
- fMarginContentEntries.reset();
+ fMarginContentEntries.free();
fLastMarginContentEntry = NULL;
fDrawingArea = kContent_DrawingArea;
- if (fFontGlyphUsage == NULL) {
+ if (fFontGlyphUsage.get() == NULL) {
fFontGlyphUsage.reset(new SkPDFGlyphSetMap());
}
}
@@ -1204,7 +1204,7 @@ ContentEntry* SkPDFDevice::getLastContentEntry() {
}
}
-SkTScopedPtr<ContentEntry>* SkPDFDevice::getContentEntries() {
+SkAutoTDelete<ContentEntry>* SkPDFDevice::getContentEntries() {
if (fDrawingArea == kContent_DrawingArea) {
return &fContentEntries;
} else {
@@ -1650,7 +1650,7 @@ ContentEntry* SkPDFDevice::setUpContentEntry(const SkClipStack* clipStack,
}
ContentEntry* entry;
- SkTScopedPtr<ContentEntry> newEntry;
+ SkAutoTDelete<ContentEntry> newEntry;
ContentEntry* lastContentEntry = getLastContentEntry();
if (lastContentEntry && lastContentEntry->fContent.getOffset() == 0) {
@@ -1667,18 +1667,18 @@ ContentEntry* SkPDFDevice::setUpContentEntry(const SkClipStack* clipStack,
return lastContentEntry;
}
- SkTScopedPtr<ContentEntry>* contentEntries = getContentEntries();
+ SkAutoTDelete<ContentEntry>* contentEntries = getContentEntries();
if (!lastContentEntry) {
contentEntries->reset(entry);
setLastContentEntry(entry);
} else if (xfermode == SkXfermode::kDstOver_Mode) {
- entry->fNext.reset(contentEntries->release());
+ entry->fNext.reset(contentEntries->detach());
contentEntries->reset(entry);
} else {
lastContentEntry->fNext.reset(entry);
setLastContentEntry(entry);
}
- newEntry.release();
+ newEntry.detach();
return entry;
}
« no previous file with comments | « src/core/SkAdvancedTypefaceMetrics.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698