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

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

Issue 1081443004: Remove checks in fxge/ge now that FX_NEW can't return 0. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix Typo. Created 5 years, 8 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_fontmap.cpp ('k') | core/src/fxge/ge/fx_ge_ps.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 "../agg/include/fx_agg_driver.h" 8 #include "../agg/include/fx_agg_driver.h"
9 #include "text_int.h" 9 #include "text_int.h"
10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 iSimilarValue = _LinuxGetSimilarValue(weight, bItalic, pitch_family, pFo nt->m_Styles); 201 iSimilarValue = _LinuxGetSimilarValue(weight, bItalic, pitch_family, pFo nt->m_Styles);
202 if (iSimilarValue > iBestSimilar) { 202 if (iSimilarValue > iBestSimilar) {
203 iBestSimilar = iSimilarValue; 203 iBestSimilar = iSimilarValue;
204 pFind = pFont; 204 pFind = pFont;
205 } 205 }
206 } 206 }
207 return pFind; 207 return pFind;
208 } 208 }
209 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault() 209 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
210 { 210 {
211 CFX_LinuxFontInfo* pInfo = FX_NEW CFX_LinuxFontInfo; 211 CFX_LinuxFontInfo* pInfo = new CFX_LinuxFontInfo;
212 if (!pInfo) {
213 return NULL;
214 }
215 if (!pInfo->ParseFontCfg()) { 212 if (!pInfo->ParseFontCfg()) {
216 pInfo->AddPath("/usr/share/fonts"); 213 pInfo->AddPath("/usr/share/fonts");
217 pInfo->AddPath("/usr/share/X11/fonts/Type1"); 214 pInfo->AddPath("/usr/share/X11/fonts/Type1");
218 pInfo->AddPath("/usr/share/X11/fonts/TTF"); 215 pInfo->AddPath("/usr/share/X11/fonts/TTF");
219 pInfo->AddPath("/usr/local/share/fonts"); 216 pInfo->AddPath("/usr/local/share/fonts");
220 } 217 }
221 return pInfo; 218 return pInfo;
222 } 219 }
223 FX_BOOL CFX_LinuxFontInfo::ParseFontCfg() 220 FX_BOOL CFX_LinuxFontInfo::ParseFontCfg()
224 { 221 {
225 return FALSE; 222 return FALSE;
226 } 223 }
227 void CFX_GEModule::InitPlatform() 224 void CFX_GEModule::InitPlatform()
228 { 225 {
229 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); 226 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
230 } 227 }
231 void CFX_GEModule::DestroyPlatform() 228 void CFX_GEModule::DestroyPlatform()
232 { 229 {
233 } 230 }
234 #endif 231 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_fontmap.cpp ('k') | core/src/fxge/ge/fx_ge_ps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698