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: core/fxge/ge/fx_ge_text.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: s/NULL/nullptr/ Created 4 years, 7 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
Index: core/fxge/ge/fx_ge_text.cpp
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index aeac66b4b07ed35090bd2d8b1f1ff6a644c96a23..fa1ede37b55ea3a31f735a9f8aa2990631d062bb 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -359,7 +359,7 @@ void Color2Argb(FX_ARGB& argb,
}
if (!CFX_GEModule::Get()->GetCodecModule() ||
!CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- pIccTransform = NULL;
+ pIccTransform = nullptr;
}
uint8_t bgra[4];
if (pIccTransform) {
@@ -847,7 +847,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont,
int anti_alias,
int& text_flags) {
if (glyph_index == (uint32_t)-1) {
- return NULL;
+ return nullptr;
}
_CFX_UniqueKeyGen keygen;
#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
@@ -941,7 +941,7 @@ CFX_SizeGlyphCache::~CFX_SizeGlyphCache() {
}
#define CONTRAST_RAMP_STEP 1
void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight) {
- FXFT_MM_Var pMasters = NULL;
+ FXFT_MM_Var pMasters = nullptr;
FXFT_Get_MM_Var(m_Face, &pMasters);
if (!pMasters) {
return;
@@ -1077,7 +1077,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
int dest_width,
int anti_alias) {
if (!m_Face) {
- return NULL;
+ return nullptr;
}
FXFT_Matrix ft_matrix;
ft_matrix.xx = (signed long)(pMatrix->GetA() / 64 * 65536);
@@ -1121,14 +1121,14 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
if (error) {
// if an error is returned, try to reload glyphs without hinting.
if (load_flags & FT_LOAD_NO_HINTING || load_flags & FT_LOAD_NO_SCALE) {
- return NULL;
+ return nullptr;
}
load_flags |= FT_LOAD_NO_HINTING;
error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
if (error) {
- return NULL;
+ return nullptr;
}
}
int weight = 0;
@@ -1141,7 +1141,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
weight > 400) {
uint32_t index = (weight - 400) / 10;
if (index >= WEIGHTPOW_ARRAY_SIZE)
- return NULL;
+ return nullptr;
int level = 0;
if (pSubstFont->m_Charset == FXFONT_SHIFTJIS_CHARSET) {
level =
@@ -1159,12 +1159,12 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
FT_LCD_FILTER_DEFAULT);
error = FXFT_Render_Glyph(m_Face, anti_alias);
if (error) {
- return NULL;
+ return nullptr;
}
int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(m_Face));
int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(m_Face));
if (bmwidth > 2048 || bmheight > 2048) {
- return NULL;
+ return nullptr;
}
int dib_width = bmwidth;
CFX_GlyphBitmap* pGlyphBitmap = new CFX_GlyphBitmap;
@@ -1358,7 +1358,7 @@ static int _Outline_CubicTo(const FXFT_Vector* control1,
};
CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, int dest_width) {
if (!m_Face) {
- return NULL;
+ return nullptr;
}
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
FXFT_Matrix ft_matrix = {65536, 0, 0, 65536};
@@ -1388,7 +1388,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, int dest_width) {
load_flags |= FT_LOAD_NO_HINTING;
}
if (FXFT_Load_Glyph(m_Face, glyph_index, load_flags))
- return NULL;
+ return nullptr;
if (m_pSubstFont && !(m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) &&
m_pSubstFont->m_Weight > 400) {
uint32_t index = (m_pSubstFont->m_Weight - 400) / 10;
@@ -1413,7 +1413,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, int dest_width) {
params.m_PointCount = 0;
FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
if (params.m_PointCount == 0) {
- return NULL;
+ return nullptr;
}
CFX_PathData* pPath = new CFX_PathData;
pPath->SetPointCount(params.m_PointCount);

Powered by Google App Engine
This is Rietveld 408576698