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

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

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits 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/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 "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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 CFX_Matrix char2device, deviceCtm, text2Device; 223 CFX_Matrix char2device, deviceCtm, text2Device;
224 if (pText2Device) { 224 if (pText2Device) {
225 char2device = *pText2Device; 225 char2device = *pText2Device;
226 text2Device = *pText2Device; 226 text2Device = *pText2Device;
227 } 227 }
228 char2device.Scale(font_size, -font_size); 228 char2device.Scale(font_size, -font_size);
229 if (FXSYS_fabs(char2device.a) + FXSYS_fabs(char2device.b) > 50 * 1.0f || 229 if (FXSYS_fabs(char2device.a) + FXSYS_fabs(char2device.b) > 50 * 1.0f ||
230 ((m_DeviceClass == FXDC_PRINTER && !m_pDeviceDriver->IsPSPrintDriver()) && 230 ((m_DeviceClass == FXDC_PRINTER && !m_pDeviceDriver->IsPSPrintDriver()) &&
231 !(text_flags & FXTEXT_PRINTIMAGETEXT))) { 231 !(text_flags & FXTEXT_PRINTIMAGETEXT))) {
232 if (pFont->GetFace() != NULL || 232 if (pFont->GetFace() ||
233 (pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) { 233 (pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
234 int nPathFlags = 234 int nPathFlags =
235 (text_flags & FXTEXT_NOSMOOTH) == 0 ? 0 : FXFILL_NOPATHSMOOTH; 235 (text_flags & FXTEXT_NOSMOOTH) == 0 ? 0 : FXFILL_NOPATHSMOOTH;
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;
(...skipping 1617 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/win32/fx_win32_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698