aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/fonts
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-08-27 07:41:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-27 07:41:16 -0700
commit96fcdcc219d2a0d3579719b84b28bede76efba64 (patch)
tree0ec5ea0193d8292df8bf5ed9dd8498a5eb5763dd /src/fonts
parent435af2f736c85c3274a0c6760a3523810750d237 (diff)
Style Change: NULL->nullptr
Diffstat (limited to 'src/fonts')
-rw-r--r--src/fonts/SkFontMgr_fontconfig.cpp34
-rw-r--r--src/fonts/SkFontMgr_indirect.cpp28
-rw-r--r--src/fonts/SkTestScalerContext.cpp4
-rw-r--r--src/fonts/SkTestScalerContext.h2
4 files changed, 34 insertions, 34 deletions
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp
index 72a5a618a8..de309d311b 100644
--- a/src/fonts/SkFontMgr_fontconfig.cpp
+++ b/src/fonts/SkFontMgr_fontconfig.cpp
@@ -60,7 +60,7 @@ static SkFontConfigInterface* RefFCI() {
// look for the last substring after a '/' and return that, or return null.
static const char* find_just_name(const char* str) {
const char* last = strrchr(str, '/');
- return last ? last + 1 : NULL;
+ return last ? last + 1 : nullptr;
}
static bool is_lower(char c) {
@@ -123,7 +123,7 @@ static FcPattern** MatchFont(FcFontSet* font_set,
}
if (iter == stop || !match_name(*iter, post_config_family)) {
- return NULL;
+ return nullptr;
}
FcPattern** firstIter = iter++;
@@ -202,11 +202,11 @@ void SkFontStyleSet_FC::getStyle(int index, SkFontStyle* style,
}
SkTypeface* SkFontStyleSet_FC::createTypeface(int index) {
- return NULL;
+ return nullptr;
}
SkTypeface* SkFontStyleSet_FC::matchStyle(const SkFontStyle& pattern) {
- return NULL;
+ return nullptr;
}
class SkFontMgr_fontconfig : public SkFontMgr {
@@ -245,7 +245,7 @@ protected:
#if 0
FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
#endif
- FcConfigSubstitute(NULL, pattern, FcMatchPattern);
+ FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
const char* post_config_family = get_name(pattern, FC_FAMILY);
@@ -254,7 +254,7 @@ protected:
FcFontSet* font_set = FcFontSort(0, pattern, 0, 0, &result);
if (!font_set) {
FcPatternDestroy(pattern);
- return NULL;
+ return nullptr;
}
int count;
@@ -262,7 +262,7 @@ protected:
if (!match) {
FcPatternDestroy(pattern);
FcFontSetDestroy(font_set);
- return NULL;
+ return nullptr;
}
FcPatternDestroy(pattern);
@@ -281,32 +281,32 @@ protected:
}
SkTypeface* onMatchFamilyStyle(const char familyName[],
- const SkFontStyle&) const override { return NULL; }
+ const SkFontStyle&) const override { return nullptr; }
SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
const char* bcp47[], int bcp47Count,
SkUnichar character) const override {
- return NULL;
+ return nullptr;
}
SkTypeface* onMatchFaceStyle(const SkTypeface*,
- const SkFontStyle&) const override { return NULL; }
+ const SkFontStyle&) const override { return nullptr; }
- SkTypeface* onCreateFromData(SkData*, int ttcIndex) const override { return NULL; }
+ SkTypeface* onCreateFromData(SkData*, int ttcIndex) const override { return nullptr; }
SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) const override {
SkAutoTDelete<SkStreamAsset> stream(bareStream);
const size_t length = stream->getLength();
if (!length) {
- return NULL;
+ return nullptr;
}
if (length >= 1024 * 1024 * 1024) {
- return NULL; // don't accept too large fonts (>= 1GB) for safety.
+ return nullptr; // don't accept too large fonts (>= 1GB) for safety.
}
// TODO should the caller give us the style or should we get it from freetype?
SkFontStyle style;
bool isFixedWidth = false;
- if (!fScanner.scanFont(stream, 0, NULL, &style, &isFixedWidth, NULL)) {
- return NULL;
+ if (!fScanner.scanFont(stream, 0, nullptr, &style, &isFixedWidth, nullptr)) {
+ return nullptr;
}
SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, stream.detach());
@@ -315,7 +315,7 @@ protected:
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[],
@@ -327,5 +327,5 @@ protected:
SkFontMgr* SkFontMgr::Factory() {
SkFontConfigInterface* fci = RefFCI();
- return fci ? new SkFontMgr_fontconfig(fci) : NULL;
+ return fci ? new SkFontMgr_fontconfig(fci) : nullptr;
}
diff --git a/src/fonts/SkFontMgr_indirect.cpp b/src/fonts/SkFontMgr_indirect.cpp
index 33c79c86c7..132130f0d8 100644
--- a/src/fonts/SkFontMgr_indirect.cpp
+++ b/src/fonts/SkFontMgr_indirect.cpp
@@ -175,8 +175,8 @@ void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const
SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const {
SkRemotableFontIdentitySet* set = fProxy->getIndex(index);
- if (NULL == set) {
- return NULL;
+ if (nullptr == set) {
+ return nullptr;
}
return new SkStyleSet_Indirect(this, index, set);
}
@@ -187,7 +187,7 @@ SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const
SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& id) const {
if (id.fDataId == SkFontIdentity::kInvalidDataId) {
- return NULL;
+ return nullptr;
}
SkAutoMutexAcquire ama(fDataCacheMutex);
@@ -202,7 +202,7 @@ SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& i
{
return entry.fTypeface;
}
- if (dataTypeface.get() == NULL &&
+ if (dataTypeface.get() == nullptr &&
!entry.fTypeface->weak_expired() && entry.fTypeface->try_ref())
{
dataTypeface.reset(entry.fTypeface);
@@ -217,22 +217,22 @@ SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& i
}
// No exact match, but did find a data match.
- if (dataTypeface.get() != NULL) {
- SkAutoTDelete<SkStreamAsset> stream(dataTypeface->openStream(NULL));
- if (stream.get() != NULL) {
+ if (dataTypeface.get() != nullptr) {
+ SkAutoTDelete<SkStreamAsset> stream(dataTypeface->openStream(nullptr));
+ if (stream.get() != nullptr) {
return fImpl->createFromStream(stream.detach(), dataTypefaceIndex);
}
}
// No data match, request data and add entry.
SkAutoTDelete<SkStreamAsset> stream(fProxy->getData(id.fDataId));
- if (stream.get() == NULL) {
- return NULL;
+ if (stream.get() == nullptr) {
+ return nullptr;
}
SkAutoTUnref<SkTypeface> typeface(fImpl->createFromStream(stream.detach(), id.fTtcIndex));
- if (typeface.get() == NULL) {
- return NULL;
+ if (typeface.get() == nullptr) {
+ return nullptr;
}
DataEntry& newEntry = fDataCache.push_back();
@@ -291,11 +291,11 @@ SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style));
- if (NULL == face.get()) {
- face.reset(this->matchFamilyStyle(NULL, style));
+ if (nullptr == face.get()) {
+ face.reset(this->matchFamilyStyle(nullptr, style));
}
- if (NULL == face.get()) {
+ if (nullptr == face.get()) {
SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style);
face.reset(this->createTypefaceFromFontId(fontId));
}
diff --git a/src/fonts/SkTestScalerContext.cpp b/src/fonts/SkTestScalerContext.cpp
index ee78381436..368f26983c 100644
--- a/src/fonts/SkTestScalerContext.cpp
+++ b/src/fonts/SkTestScalerContext.cpp
@@ -24,7 +24,7 @@ SkTestFont::SkTestFont(const SkTestFontData& fontData)
, fWidths(fontData.fWidths)
, fMetrics(fontData.fMetrics)
, fName(fontData.fName)
- , fPaths(NULL)
+ , fPaths(nullptr)
{
init(fontData.fPoints, fontData.fVerbs);
#ifdef SK_DEBUG
@@ -173,7 +173,7 @@ SkTypeface::LocalizedStrings* SkTestTypeface::onCreateFamilyNameIterator() const
SkString familyName(fTestFont->fName);
SkString language("und"); //undetermined
SkASSERT(0); // incomplete
- return NULL;
+ return nullptr;
// return new SkOTUtils::LocalizedStrings_SingleName(familyName, language);
}
diff --git a/src/fonts/SkTestScalerContext.h b/src/fonts/SkTestScalerContext.h
index 95316d7d5b..fe5c8d6ffc 100644
--- a/src/fonts/SkTestScalerContext.h
+++ b/src/fonts/SkTestScalerContext.h
@@ -74,7 +74,7 @@ protected:
uint32_t glyphIDsCount) const override;
SkStreamAsset* onOpenStream(int* ttcIndex) const override {
- return NULL;
+ return nullptr;
}
void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const override;