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

Unified Diff: src/core/SkGlyphCache.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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/SkFontMgr.cpp ('k') | src/core/SkGlyphCache_Globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache.cpp
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
old mode 100755
new mode 100644
index e719c00b8352ba01f6d4252a58ab9cb1f807e50f..ff520041285d404f1d381c81cd347f64455a11ac
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -17,9 +17,7 @@
namespace {
-SkGlyphCache_Globals* create_globals() {
- return SkNEW(SkGlyphCache_Globals);
-}
+SkGlyphCache_Globals* create_globals() { return new SkGlyphCache_Globals; }
} // namespace
@@ -55,13 +53,9 @@ SkGlyphCache::SkGlyphCache(SkTypeface* typeface, const SkDescriptor* desc, SkSca
}
SkGlyphCache::~SkGlyphCache() {
- fGlyphMap.foreach(
- [](SkGlyph* g) {
- SkDELETE(g->fPath);
- }
- );
+ fGlyphMap.foreach ([](SkGlyph* g) { delete g->fPath; });
SkDescriptor::Free(fDesc);
- SkDELETE(fScalerContext);
+ delete fScalerContext;
this->invokeAndRemoveAuxProcs();
}
@@ -221,7 +215,7 @@ const void* SkGlyphCache::findImage(const SkGlyph& glyph) {
const SkPath* SkGlyphCache::findPath(const SkGlyph& glyph) {
if (glyph.fWidth) {
if (glyph.fPath == NULL) {
- const_cast<SkGlyph&>(glyph).fPath = SkNEW(SkPath);
+ const_cast<SkGlyph&>(glyph).fPath = new SkPath;
fScalerContext->getPath(glyph, glyph.fPath);
fMemoryUsed += sizeof(SkPath) +
glyph.fPath->countPoints() * sizeof(SkPoint);
@@ -279,7 +273,7 @@ void SkGlyphCache::setAuxProc(void (*proc)(void*), void* data) {
rec = rec->fNext;
}
// not found, create a new rec
- rec = SkNEW(AuxProcRec);
+ rec = new AuxProcRec;
rec->fProc = proc;
rec->fData = data;
rec->fNext = fAuxProcList;
@@ -291,7 +285,7 @@ void SkGlyphCache::invokeAndRemoveAuxProcs() {
while (rec) {
rec->fProc(rec->fData);
AuxProcRec* next = rec->fNext;
- SkDELETE(rec);
+ delete rec;
rec = next;
}
}
@@ -387,7 +381,7 @@ SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
ctx = typeface->createScalerContext(desc, false);
SkASSERT(ctx);
}
- cache = SkNEW_ARGS(SkGlyphCache, (typeface, desc, ctx));
+ cache = new SkGlyphCache(typeface, desc, ctx);
}
AutoValidate av(cache);
@@ -502,7 +496,7 @@ size_t SkGlyphCache_Globals::internalPurge(size_t minBytesNeeded) {
countFreed += 1;
this->internalDetachCache(cache);
- SkDELETE(cache);
+ delete cache;
cache = prev;
}
« no previous file with comments | « src/core/SkFontMgr.cpp ('k') | src/core/SkGlyphCache_Globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698