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

Unified Diff: src/ports/SkFontMgr_android.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/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_custom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_android.cpp
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 45c787a930220974d885f7c36908c04849121c4f..dc89d91931b965033932967075e2dd3a6df93132 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -204,33 +204,27 @@ public:
// TODO: warn on defaulted axis?
}
- SkDEBUGCODE (
- // Check for axis specified, but not matched in font.
- for (int i = 0; i < fontFile.fAxes.count(); ++i) {
- SkFourByteTag skTag = fontFile.fAxes[i].fTag;
- bool found = false;
- for (int j = 0; j < axisDefinitions.count(); ++j) {
- if (skTag == axisDefinitions[j].fTag) {
- found = true;
- break;
+ SkDEBUGCODE(
+ // Check for axis specified, but not matched in font.
+ for (int i = 0; i < fontFile.fAxes.count(); ++i) {
+ SkFourByteTag skTag = fontFile.fAxes[i].fTag;
+ bool found = false;
+ for (int j = 0; j < axisDefinitions.count(); ++j) {
+ if (skTag == axisDefinitions[j].fTag) {
+ found = true;
+ break;
+ }
}
- }
- if (!found) {
- SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n",
- familyName.c_str(),
- (skTag >> 24) & 0xFF,
- (skTag >> 16) & 0xFF,
- (skTag >> 8) & 0xFF,
- (skTag ) & 0xFF));
- }
- }
- )
+ if (!found) {
+ SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n",
+ familyName.c_str(), (skTag >> 24) & 0xFF,
+ (skTag >> 16) & 0xFF, (skTag >> 8) & 0xFF, (skTag)&0xFF));
+ }
+ })
- fStyles.push_back().reset(SkNEW_ARGS(SkTypeface_AndroidSystem,
- (pathName, ttcIndex,
- axisValues.get(), axisDefinitions.count(),
- style, isFixedWidth, familyName,
- lang, variant)));
+ fStyles.push_back().reset(new SkTypeface_AndroidSystem(
+ pathName, ttcIndex, axisValues.get(), axisDefinitions.count(), style,
+ isFixedWidth, familyName, lang, variant));
}
}
@@ -476,7 +470,7 @@ protected:
return NULL;
}
SkFontData* data(new SkFontData(stream.detach(), ttcIndex, NULL, 0));
- return SkNEW_ARGS(SkTypeface_AndroidStream, (data, style, isFixedPitch, name));
+ return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
}
SkTypeface* onCreateFromFontData(SkFontData* data) const override {
@@ -487,7 +481,7 @@ protected:
if (!fScanner.scanFont(stream, data->getIndex(), &name, &style, &isFixedPitch, NULL)) {
return NULL;
}
- return SkNEW_ARGS(SkTypeface_AndroidStream, (data, style, isFixedPitch, name));
+ return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
}
@@ -531,17 +525,16 @@ private:
}
}
- SkFontStyleSet_Android* newSet =
- SkNEW_ARGS(SkFontStyleSet_Android, (family, fScanner));
+ SkFontStyleSet_Android* newSet = new SkFontStyleSet_Android(family, fScanner);
if (0 == newSet->count()) {
- SkDELETE(newSet);
+ delete newSet;
continue;
}
fFontStyleSets.push_back().reset(newSet);
for (int j = 0; j < family.fNames.count(); j++) {
NameToFamily* nextEntry = nameToFamily->append();
- SkNEW_PLACEMENT_ARGS(&nextEntry->name, SkString, (family.fNames[j]));
+ new (&nextEntry->name) SkString(family.fNames[j]);
nextEntry->styleSet = newSet;
}
}
@@ -591,5 +584,5 @@ SkFontMgr* SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom) {
custom->fFallbackFontsXml));
}
- return SkNEW_ARGS(SkFontMgr_Android, (custom));
+ return new SkFontMgr_Android(custom);
}
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_custom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698