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

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

Issue 1135893008: Re-land: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_ps.cpp ('k') | core/src/fxge/win32/fx_win32_device.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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxge/fx_freetype.h" 8 #include "../../../include/fxge/fx_freetype.h"
9 #include "../../../include/fxcodec/fx_codec.h" 9 #include "../../../include/fxcodec/fx_codec.h"
10 #include "text_int.h" 10 #include "text_int.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 } 197 }
198 } 198 }
199 } 199 }
200 if (pCache == NULL) { 200 if (pCache == NULL) {
201 pCache = CFX_GEModule::Get()->GetFontCache(); 201 pCache = CFX_GEModule::Get()->GetFontCache();
202 } 202 }
203 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); 203 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
204 FX_FONTCACHE_DEFINE(pCache, pFont); 204 FX_FONTCACHE_DEFINE(pCache, pFont);
205 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars); 205 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars);
206 if (!pGlyphAndPos) {
207 return FALSE;
208 }
209 int iChar; 206 int iChar;
210 deviceCtm = char2device; 207 deviceCtm = char2device;
211 CFX_AffineMatrix matrixCTM = GetCTM(); 208 CFX_AffineMatrix matrixCTM = GetCTM();
212 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); 209 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a);
213 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); 210 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d);
214 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0); 211 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0);
215 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0); 212 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0);
216 for (iChar = 0; iChar < nChars; iChar ++) { 213 for (iChar = 0; iChar < nChars; iChar ++) {
217 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; 214 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
218 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; 215 const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 { 1672 {
1676 va_list argList; 1673 va_list argList;
1677 va_start(argList, count); 1674 va_start(argList, count);
1678 for (int i = 0; i < count; i ++) { 1675 for (int i = 0; i < count; i ++) {
1679 int p = va_arg(argList, int); 1676 int p = va_arg(argList, int);
1680 ((FX_DWORD*)m_Key)[i] = p; 1677 ((FX_DWORD*)m_Key)[i] = p;
1681 } 1678 }
1682 va_end(argList); 1679 va_end(argList);
1683 m_KeyLen = count * sizeof(FX_DWORD); 1680 m_KeyLen = count * sizeof(FX_DWORD);
1684 } 1681 }
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_ps.cpp ('k') | core/src/fxge/win32/fx_win32_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698