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

Side by Side Diff: core/src/fxge/ge/fx_ge_text.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years 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 unified diff | Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_ps.cpp ('k') | core/src/fxge/skia/fx_skia_blitter_new.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/include/fxge/fx_ge.h" 7 #include "core/include/fxge/fx_ge.h"
8 #include "core/include/fxge/fx_freetype.h" 8 #include "core/include/fxge/fx_freetype.h"
9 #include "core/include/fxcodec/fx_codec.h" 9 #include "core/include/fxcodec/fx_codec.h"
10 #include "text_int.h" 10 #include "text_int.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, 44 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos,
45 int nChars, 45 int nChars,
46 int anti_alias, 46 int anti_alias,
47 FX_FLOAT retinaScaleX, 47 FX_FLOAT retinaScaleX,
48 FX_FLOAT retinaScaleY) { 48 FX_FLOAT retinaScaleY) {
49 FX_RECT rect(0, 0, 0, 0); 49 FX_RECT rect(0, 0, 0, 0);
50 FX_BOOL bStarted = FALSE; 50 FX_BOOL bStarted = FALSE;
51 for (int iChar = 0; iChar < nChars; iChar++) { 51 for (int iChar = 0; iChar < nChars; iChar++) {
52 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; 52 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
53 const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph; 53 const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph;
54 if (pGlyph == NULL) { 54 if (!pGlyph) {
55 continue; 55 continue;
56 } 56 }
57 int char_left = glyph.m_OriginX + pGlyph->m_Left; 57 int char_left = glyph.m_OriginX + pGlyph->m_Left;
58 int char_width = (int)(pGlyph->m_Bitmap.GetWidth() / retinaScaleX); 58 int char_width = (int)(pGlyph->m_Bitmap.GetWidth() / retinaScaleX);
59 if (anti_alias == FXFT_RENDER_MODE_LCD) { 59 if (anti_alias == FXFT_RENDER_MODE_LCD) {
60 char_width /= 3; 60 char_width /= 3;
61 } 61 }
62 int char_right = char_left + char_width; 62 int char_right = char_left + char_width;
63 int char_top = glyph.m_OriginY - pGlyph->m_Top; 63 int char_top = glyph.m_OriginY - pGlyph->m_Top;
64 int char_bottom = 64 int char_bottom =
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 228, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 239, 240, 134 228, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 239, 240,
135 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 250, 251, 252, 253, 254, 135 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 250, 251, 252, 253, 254,
136 255, 136 255,
137 }; 137 };
138 #define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \ 138 #define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \
139 src_alpha = g_TextGammaAdjust[(uint8_t)src_alpha]; 139 src_alpha = g_TextGammaAdjust[(uint8_t)src_alpha];
140 void _Color2Argb(FX_ARGB& argb, 140 void _Color2Argb(FX_ARGB& argb,
141 FX_DWORD color, 141 FX_DWORD color,
142 int alpha_flag, 142 int alpha_flag,
143 void* pIccTransform) { 143 void* pIccTransform) {
144 if (pIccTransform == NULL && !FXGETFLAG_COLORTYPE(alpha_flag)) { 144 if (!pIccTransform && !FXGETFLAG_COLORTYPE(alpha_flag)) {
145 argb = color; 145 argb = color;
146 return; 146 return;
147 } 147 }
148 if (!CFX_GEModule::Get()->GetCodecModule() || 148 if (!CFX_GEModule::Get()->GetCodecModule() ||
149 !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { 149 !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
150 pIccTransform = NULL; 150 pIccTransform = NULL;
151 } 151 }
152 uint8_t bgra[4]; 152 uint8_t bgra[4];
153 if (pIccTransform) { 153 if (pIccTransform) {
154 ICodec_IccModule* pIccModule = 154 ICodec_IccModule* pIccModule =
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return DrawTextPath(nChars, pCharPos, pFont, pCache, font_size, 236 return DrawTextPath(nChars, pCharPos, pFont, pCache, font_size,
237 pText2Device, NULL, NULL, fill_color, 0, NULL, 237 pText2Device, NULL, NULL, fill_color, 0, NULL,
238 nPathFlags, alpha_flag, pIccTransform); 238 nPathFlags, alpha_flag, pIccTransform);
239 } 239 }
240 } 240 }
241 int anti_alias = FXFT_RENDER_MODE_MONO; 241 int anti_alias = FXFT_RENDER_MODE_MONO;
242 FX_BOOL bNormal = FALSE; 242 FX_BOOL bNormal = FALSE;
243 if ((text_flags & FXTEXT_NOSMOOTH) == 0) { 243 if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
244 if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) { 244 if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) {
245 FX_BOOL bClearType; 245 FX_BOOL bClearType;
246 if (pFont->GetFace() == NULL && 246 if (!pFont->GetFace() &&
247 !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) { 247 !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) {
248 bClearType = FALSE; 248 bClearType = FALSE;
249 } else { 249 } else {
250 bClearType = text_flags & FXTEXT_CLEARTYPE; 250 bClearType = text_flags & FXTEXT_CLEARTYPE;
251 } 251 }
252 if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) { 252 if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
253 anti_alias = FXFT_RENDER_MODE_LCD; 253 anti_alias = FXFT_RENDER_MODE_LCD;
254 bNormal = TRUE; 254 bNormal = TRUE;
255 } else if (m_bpp < 16) { 255 } else if (m_bpp < 16) {
256 anti_alias = FXFT_RENDER_MODE_NORMAL; 256 anti_alias = FXFT_RENDER_MODE_NORMAL;
257 } else { 257 } else {
258 if (bClearType == FALSE) { 258 if (bClearType == FALSE) {
259 anti_alias = FXFT_RENDER_MODE_LCD; 259 anti_alias = FXFT_RENDER_MODE_LCD;
260 bNormal = TRUE; 260 bNormal = TRUE;
261 } else { 261 } else {
262 anti_alias = FXFT_RENDER_MODE_LCD; 262 anti_alias = FXFT_RENDER_MODE_LCD;
263 } 263 }
264 } 264 }
265 } 265 }
266 } 266 }
267 if (pCache == NULL) { 267 if (!pCache) {
268 pCache = CFX_GEModule::Get()->GetFontCache(); 268 pCache = CFX_GEModule::Get()->GetFontCache();
269 } 269 }
270 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); 270 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
271 FX_FONTCACHE_DEFINE(pCache, pFont); 271 FX_FONTCACHE_DEFINE(pCache, pFont);
272 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars); 272 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars);
273 int iChar; 273 int iChar;
274 deviceCtm = char2device; 274 deviceCtm = char2device;
275 CFX_Matrix matrixCTM = GetCTM(); 275 CFX_Matrix matrixCTM = GetCTM();
276 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); 276 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a);
277 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); 277 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 int pixel_top = FXSYS_round(bmp_rect.top * scale_y); 328 int pixel_top = FXSYS_round(bmp_rect.top * scale_y);
329 if (anti_alias == FXFT_RENDER_MODE_MONO) { 329 if (anti_alias == FXFT_RENDER_MODE_MONO) {
330 CFX_DIBitmap bitmap; 330 CFX_DIBitmap bitmap;
331 if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) { 331 if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) {
332 FX_Free(pGlyphAndPos); 332 FX_Free(pGlyphAndPos);
333 return FALSE; 333 return FALSE;
334 } 334 }
335 bitmap.Clear(0); 335 bitmap.Clear(0);
336 for (iChar = 0; iChar < nChars; iChar++) { 336 for (iChar = 0; iChar < nChars; iChar++) {
337 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; 337 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
338 if (glyph.m_pGlyph == NULL) { 338 if (!glyph.m_pGlyph) {
339 continue; 339 continue;
340 } 340 }
341 const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap; 341 const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap;
342 bitmap.TransferBitmap( 342 bitmap.TransferBitmap(
343 glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left, 343 glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left,
344 glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top, 344 glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top,
345 pGlyph->GetWidth(), pGlyph->GetHeight(), pGlyph, 0, 0); 345 pGlyph->GetWidth(), pGlyph->GetHeight(), pGlyph, 0, 0);
346 } 346 }
347 FX_Free(pGlyphAndPos); 347 FX_Free(pGlyphAndPos);
348 return SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color); 348 return SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color);
(...skipping 29 matching lines...) Expand all
378 int a, r, g, b; 378 int a, r, g, b;
379 if (anti_alias == FXFT_RENDER_MODE_LCD) { 379 if (anti_alias == FXFT_RENDER_MODE_LCD) {
380 _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform); 380 _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
381 ArgbDecode(fill_color, a, r, g, b); 381 ArgbDecode(fill_color, a, r, g, b);
382 r = FX_GAMMA(r); 382 r = FX_GAMMA(r);
383 g = FX_GAMMA(g); 383 g = FX_GAMMA(g);
384 b = FX_GAMMA(b); 384 b = FX_GAMMA(b);
385 } 385 }
386 for (iChar = 0; iChar < nChars; iChar++) { 386 for (iChar = 0; iChar < nChars; iChar++) {
387 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; 387 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
388 if (glyph.m_pGlyph == NULL) { 388 if (!glyph.m_pGlyph) {
389 continue; 389 continue;
390 } 390 }
391 const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap; 391 const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap;
392 int left = glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left; 392 int left = glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left;
393 int top = glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top; 393 int top = glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top;
394 int ncols = pGlyph->GetWidth(); 394 int ncols = pGlyph->GetWidth();
395 int nrows = pGlyph->GetHeight(); 395 int nrows = pGlyph->GetHeight();
396 if (anti_alias == FXFT_RENDER_MODE_NORMAL) { 396 if (anti_alias == FXFT_RENDER_MODE_NORMAL) {
397 if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color, 0, 397 if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color, 0,
398 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, 398 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag,
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 const CFX_Matrix* pText2User, 1111 const CFX_Matrix* pText2User,
1112 const CFX_Matrix* pUser2Device, 1112 const CFX_Matrix* pUser2Device,
1113 const CFX_GraphStateData* pGraphState, 1113 const CFX_GraphStateData* pGraphState,
1114 FX_DWORD fill_color, 1114 FX_DWORD fill_color,
1115 FX_ARGB stroke_color, 1115 FX_ARGB stroke_color,
1116 CFX_PathData* pClippingPath, 1116 CFX_PathData* pClippingPath,
1117 int nFlag, 1117 int nFlag,
1118 int alpha_flag, 1118 int alpha_flag,
1119 void* pIccTransform, 1119 void* pIccTransform,
1120 int blend_type) { 1120 int blend_type) {
1121 if (pCache == NULL) { 1121 if (!pCache) {
1122 pCache = CFX_GEModule::Get()->GetFontCache(); 1122 pCache = CFX_GEModule::Get()->GetFontCache();
1123 } 1123 }
1124 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); 1124 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
1125 FX_FONTCACHE_DEFINE(pCache, pFont); 1125 FX_FONTCACHE_DEFINE(pCache, pFont);
1126 for (int iChar = 0; iChar < nChars; iChar++) { 1126 for (int iChar = 0; iChar < nChars; iChar++) {
1127 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; 1127 const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
1128 CFX_Matrix matrix; 1128 CFX_Matrix matrix;
1129 if (charpos.m_bGlyphAdjust) 1129 if (charpos.m_bGlyphAdjust)
1130 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1], 1130 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
1131 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0); 1131 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
1132 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, 1132 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX,
1133 charpos.m_OriginY); 1133 charpos.m_OriginY);
1134 const CFX_PathData* pPath = pFaceCache->LoadGlyphPath( 1134 const CFX_PathData* pPath = pFaceCache->LoadGlyphPath(
1135 pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth); 1135 pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
1136 if (pPath == NULL) { 1136 if (!pPath) {
1137 continue; 1137 continue;
1138 } 1138 }
1139 matrix.Concat(*pText2User); 1139 matrix.Concat(*pText2User);
1140 CFX_PathData TransformedPath(*pPath); 1140 CFX_PathData TransformedPath(*pPath);
1141 TransformedPath.Transform(&matrix); 1141 TransformedPath.Transform(&matrix);
1142 FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) 1142 FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag)
1143 ? (FXGETFLAG_ALPHA_FILL(alpha_flag) || 1143 ? (FXGETFLAG_ALPHA_FILL(alpha_flag) ||
1144 FXGETFLAG_ALPHA_STROKE(alpha_flag)) 1144 FXGETFLAG_ALPHA_STROKE(alpha_flag))
1145 : (fill_color || stroke_color); 1145 : (fill_color || stroke_color);
1146 if (bHasAlpha) { 1146 if (bHasAlpha) {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 CFX_SizeGlyphCache::~CFX_SizeGlyphCache() { 1371 CFX_SizeGlyphCache::~CFX_SizeGlyphCache() {
1372 for (const auto& pair : m_GlyphMap) { 1372 for (const auto& pair : m_GlyphMap) {
1373 delete pair.second; 1373 delete pair.second;
1374 } 1374 }
1375 m_GlyphMap.clear(); 1375 m_GlyphMap.clear();
1376 } 1376 }
1377 #define CONTRAST_RAMP_STEP 1 1377 #define CONTRAST_RAMP_STEP 1
1378 void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight) { 1378 void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight) {
1379 FXFT_MM_Var pMasters = NULL; 1379 FXFT_MM_Var pMasters = NULL;
1380 FXFT_Get_MM_Var(m_Face, &pMasters); 1380 FXFT_Get_MM_Var(m_Face, &pMasters);
1381 if (pMasters == NULL) { 1381 if (!pMasters) {
1382 return; 1382 return;
1383 } 1383 }
1384 long coords[2]; 1384 long coords[2];
1385 if (weight == 0) { 1385 if (weight == 0) {
1386 coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536; 1386 coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536;
1387 } else { 1387 } else {
1388 coords[0] = weight; 1388 coords[0] = weight;
1389 } 1389 }
1390 if (dest_width == 0) { 1390 if (dest_width == 0) {
1391 coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; 1391 coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 *pDstRow++ = (uint8_t)temp; 1504 *pDstRow++ = (uint8_t)temp;
1505 } 1505 }
1506 } 1506 }
1507 } 1507 }
1508 CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, 1508 CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
1509 FX_DWORD glyph_index, 1509 FX_DWORD glyph_index,
1510 FX_BOOL bFontStyle, 1510 FX_BOOL bFontStyle,
1511 const CFX_Matrix* pMatrix, 1511 const CFX_Matrix* pMatrix,
1512 int dest_width, 1512 int dest_width,
1513 int anti_alias) { 1513 int anti_alias) {
1514 if (m_Face == NULL) { 1514 if (!m_Face) {
1515 return NULL; 1515 return NULL;
1516 } 1516 }
1517 FXFT_Matrix ft_matrix; 1517 FXFT_Matrix ft_matrix;
1518 ft_matrix.xx = (signed long)(pMatrix->GetA() / 64 * 65536); 1518 ft_matrix.xx = (signed long)(pMatrix->GetA() / 64 * 65536);
1519 ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536); 1519 ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536);
1520 ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536); 1520 ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536);
1521 ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536); 1521 ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536);
1522 FX_BOOL bUseCJKSubFont = FALSE; 1522 FX_BOOL bUseCJKSubFont = FALSE;
1523 const CFX_SubstFont* pSubstFont = pFont->GetSubstFont(); 1523 const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
1524 if (pSubstFont) { 1524 if (pSubstFont) {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 to->y / param->m_CoordUnit; 1780 to->y / param->m_CoordUnit;
1781 param->m_pPoints[param->m_PointCount + 2].m_Flag = FXPT_BEZIERTO; 1781 param->m_pPoints[param->m_PointCount + 2].m_Flag = FXPT_BEZIERTO;
1782 param->m_CurX = to->x; 1782 param->m_CurX = to->x;
1783 param->m_CurY = to->y; 1783 param->m_CurY = to->y;
1784 } 1784 }
1785 param->m_PointCount += 3; 1785 param->m_PointCount += 3;
1786 return 0; 1786 return 0;
1787 } 1787 }
1788 }; 1788 };
1789 CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) { 1789 CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) {
1790 if (m_Face == NULL) { 1790 if (!m_Face) {
1791 return NULL; 1791 return NULL;
1792 } 1792 }
1793 FXFT_Set_Pixel_Sizes(m_Face, 0, 64); 1793 FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
1794 FXFT_Matrix ft_matrix = {65536, 0, 0, 65536}; 1794 FXFT_Matrix ft_matrix = {65536, 0, 0, 65536};
1795 if (m_pSubstFont) { 1795 if (m_pSubstFont) {
1796 if (m_pSubstFont->m_ItalicAngle) { 1796 if (m_pSubstFont->m_ItalicAngle) {
1797 int skew = m_pSubstFont->m_ItalicAngle; 1797 int skew = m_pSubstFont->m_ItalicAngle;
1798 skew = skew <= -ANGLESKEW_ARRAY_SIZE ? -58 : -g_AngleSkew[-skew]; 1798 skew = skew <= -ANGLESKEW_ARRAY_SIZE ? -58 : -g_AngleSkew[-skew];
1799 if (m_bVertical) { 1799 if (m_bVertical) {
1800 ft_matrix.yx += ft_matrix.yy * skew / 100; 1800 ft_matrix.yx += ft_matrix.yy * skew / 100;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 void _CFX_UniqueKeyGen::Generate(int count, ...) { 1860 void _CFX_UniqueKeyGen::Generate(int count, ...) {
1861 va_list argList; 1861 va_list argList;
1862 va_start(argList, count); 1862 va_start(argList, count);
1863 for (int i = 0; i < count; i++) { 1863 for (int i = 0; i < count; i++) {
1864 int p = va_arg(argList, int); 1864 int p = va_arg(argList, int);
1865 ((FX_DWORD*)m_Key)[i] = p; 1865 ((FX_DWORD*)m_Key)[i] = p;
1866 } 1866 }
1867 va_end(argList); 1867 va_end(argList);
1868 m_KeyLen = count * sizeof(FX_DWORD); 1868 m_KeyLen = count * sizeof(FX_DWORD);
1869 } 1869 }
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_ps.cpp ('k') | core/src/fxge/skia/fx_skia_blitter_new.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698