Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002
Review URL: https://codereview.chromium.org/1316233002
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index 496a54c..7f3ce6b 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -63,7 +63,7 @@
SkTypeface_Empty() : INHERITED(SkFontStyle(), false, true, SkString(), 0) {}
protected:
- SkStreamAsset* onOpenStream(int*) const override { return NULL; }
+ SkStreamAsset* onOpenStream(int*) const override { return nullptr; }
private:
typedef SkTypeface_Custom INHERITED;
@@ -156,7 +156,7 @@
SkTypeface* matchStyle(const SkFontStyle& pattern) override {
if (0 == fStyles.count()) {
- return NULL;
+ return nullptr;
}
SkTypeface_Custom* closest = fStyles[0];
@@ -203,30 +203,30 @@
virtual ~SystemFontLoader() { }
virtual void loadSystemFonts(const SkTypeface_FreeType::Scanner&, Families*) const = 0;
};
- explicit SkFontMgr_Custom(const SystemFontLoader& loader) : fDefaultFamily(NULL) {
+ explicit SkFontMgr_Custom(const SystemFontLoader& loader) : fDefaultFamily(nullptr) {
loader.loadSystemFonts(fScanner, &fFamilies);
// Try to pick a default font.
static const char* defaultNames[] = {
- "Arial", "Verdana", "Times New Roman", "Droid Sans", NULL
+ "Arial", "Verdana", "Times New Roman", "Droid Sans", nullptr
};
for (size_t i = 0; i < SK_ARRAY_COUNT(defaultNames); ++i) {
SkFontStyleSet_Custom* set = this->onMatchFamily(defaultNames[i]);
- if (NULL == set) {
+ if (nullptr == set) {
continue;
}
SkTypeface* tf = set->matchStyle(SkFontStyle(SkFontStyle::kNormal_Weight,
SkFontStyle::kNormal_Width,
SkFontStyle::kUpright_Slant));
- if (NULL == tf) {
+ if (nullptr == tf) {
continue;
}
fDefaultFamily = set;
break;
}
- if (NULL == fDefaultFamily) {
+ if (nullptr == fDefaultFamily) {
fDefaultFamily = fFamilies[0];
}
}
@@ -252,7 +252,7 @@
return SkRef(fFamilies[i].get());
}
}
- return NULL;
+ return nullptr;
}
SkTypeface* onMatchFamilyStyle(const char familyName[],
@@ -266,7 +266,7 @@
const char* bcp47[], int bcp47Count,
SkUnichar character) const override
{
- return NULL;
+ return nullptr;
}
SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember,
@@ -279,7 +279,7 @@
}
}
}
- return NULL;
+ return nullptr;
}
SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
@@ -288,24 +288,24 @@
SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) const override {
SkAutoTDelete<SkStreamAsset> stream(bareStream);
- if (NULL == stream || stream->getLength() <= 0) {
- return NULL;
+ if (nullptr == stream || stream->getLength() <= 0) {
+ return nullptr;
}
bool isFixedPitch;
SkFontStyle style;
SkString name;
- if (fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, NULL)) {
+ if (fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, nullptr)) {
return new SkTypeface_Stream(style, isFixedPitch, false, name, stream.detach(),
ttcIndex);
} else {
- return NULL;
+ return nullptr;
}
}
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
- return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL;
+ return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : nullptr;
}
SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
@@ -317,13 +317,13 @@
oldStyle & SkTypeface::kItalic
? SkFontStyle::kItalic_Slant
: SkFontStyle::kUpright_Slant);
- SkTypeface* tf = NULL;
+ SkTypeface* tf = nullptr;
if (familyName) {
tf = this->onMatchFamilyStyle(familyName, style);
}
- if (NULL == tf) {
+ if (nullptr == tf) {
tf = fDefaultFamily->matchStyle(style);
}
@@ -366,7 +366,7 @@
return families[i].get();
}
}
- return NULL;
+ return nullptr;
}
static void load_directory_fonts(const SkTypeface_FreeType::Scanner& scanner,
@@ -394,7 +394,7 @@
bool isFixedPitch;
SkString realname;
SkFontStyle style = SkFontStyle(); // avoid uninitialized warning
- if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, NULL)) {
+ if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, nullptr)) {
SkDebugf("---- failed to open <%s> <%d> as a font\n",
filename.c_str(), faceIndex);
continue;
@@ -405,7 +405,7 @@
realname, filename.c_str(), faceIndex);
SkFontStyleSet_Custom* addTo = find_family(*families, realname.c_str());
- if (NULL == addTo) {
+ if (nullptr == addTo) {
addTo = new SkFontStyleSet_Custom(realname);
families->push_back().reset(addTo);
}
@@ -463,7 +463,7 @@
return families[i].get();
}
}
- return NULL;
+ return nullptr;
}
static void load_embedded_font(const SkTypeface_FreeType::Scanner& scanner,
@@ -482,7 +482,7 @@
bool isFixedPitch;
SkString realname;
SkFontStyle style = SkFontStyle(); // avoid uninitialized warning
- if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, NULL)) {
+ if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, nullptr)) {
SkDebugf("---- failed to open <%d> <%d> as a font\n", index, faceIndex);
return;
}
@@ -492,7 +492,7 @@
realname, stream.detach(), faceIndex);
SkFontStyleSet_Custom* addTo = find_family(*families, realname.c_str());
- if (NULL == addTo) {
+ if (nullptr == addTo) {
addTo = new SkFontStyleSet_Custom(realname);
families->push_back().reset(addTo);
}