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

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

Issue 1143663008: Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebased. 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 } 193 }
194 } 194 }
195 } 195 }
196 if (pCache == NULL) { 196 if (pCache == NULL) {
197 pCache = CFX_GEModule::Get()->GetFontCache(); 197 pCache = CFX_GEModule::Get()->GetFontCache();
198 } 198 }
199 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); 199 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
200 FX_FONTCACHE_DEFINE(pCache, pFont); 200 FX_FONTCACHE_DEFINE(pCache, pFont);
201 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars); 201 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars);
202 if (!pGlyphAndPos) {
203 return FALSE;
204 }
205 int iChar; 202 int iChar;
206 deviceCtm = char2device; 203 deviceCtm = char2device;
207 CFX_AffineMatrix matrixCTM = GetCTM(); 204 CFX_AffineMatrix matrixCTM = GetCTM();
208 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); 205 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a);
209 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); 206 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d);
210 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0); 207 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0);
211 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0); 208 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0);
212 for (iChar = 0; iChar < nChars; iChar ++) { 209 for (iChar = 0; iChar < nChars; iChar ++) {
213 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; 210 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
214 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; 211 const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 { 1691 {
1695 va_list argList; 1692 va_list argList;
1696 va_start(argList, count); 1693 va_start(argList, count);
1697 for (int i = 0; i < count; i ++) { 1694 for (int i = 0; i < count; i ++) {
1698 int p = va_arg(argList, int); 1695 int p = va_arg(argList, int);
1699 ((FX_DWORD*)m_Key)[i] = p; 1696 ((FX_DWORD*)m_Key)[i] = p;
1700 } 1697 }
1701 va_end(argList); 1698 va_end(argList);
1702 m_KeyLen = count * sizeof(FX_DWORD); 1699 m_KeyLen = count * sizeof(FX_DWORD);
1703 } 1700 }
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