From 4cb07c9c9cd5761ce3179d3d7254c1cf0efeafa5 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 17 Apr 2015 15:15:08 -0700 Subject: Fix all remaining instances of FX_NEW. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1084613006 --- core/src/fxge/android/fpf_skiafontmgr.cpp | 19 ++++++------------- core/src/fxge/android/fpf_skiamodule.cpp | 7 ++----- core/src/fxge/android/fx_android_imp.cpp | 5 +---- 3 files changed, 9 insertions(+), 22 deletions(-) (limited to 'core/src/fxge/android') diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp index a9bef8a2b8..fc012ea9ac 100644 --- a/core/src/fxge/android/fpf_skiafontmgr.cpp +++ b/core/src/fxge/android/fpf_skiafontmgr.cpp @@ -352,16 +352,12 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, } if (nItem > -1) { CFPF_SkiaFontDescriptor *pFontDes = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(nItem); - CFPF_SkiaFont *pFont = FX_NEW CFPF_SkiaFont; - if (pFont) { - if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) { - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); - return pFont->Retain(); - } - pFont->Release(); - pFont = NULL; + CFPF_SkiaFont *pFont = new CFPF_SkiaFont; + if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) { + m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + return pFont->Retain(); } - return pFont; + pFont->Release(); } return NULL; } @@ -464,10 +460,7 @@ void CFPF_SkiaFontMgr::ScanFile(FX_BSTR file) { FXFT_Face face = GetFontFace(file); if (face) { - CFPF_SkiaPathFont *pFontDesc = FX_NEW CFPF_SkiaPathFont; - if (!pFontDesc) { - return; - } + CFPF_SkiaPathFont *pFontDesc = new CFPF_SkiaPathFont; pFontDesc->SetPath(file.GetCStr()); ReportFace(face, pFontDesc); m_FontFaces.Add(pFontDesc); diff --git a/core/src/fxge/android/fpf_skiamodule.cpp b/core/src/fxge/android/fpf_skiamodule.cpp index 94e68885fc..6b5987d1b7 100644 --- a/core/src/fxge/android/fpf_skiamodule.cpp +++ b/core/src/fxge/android/fpf_skiamodule.cpp @@ -12,7 +12,7 @@ static IFPF_DeviceModule *gs_pPFModule = NULL; IFPF_DeviceModule* FPF_GetDeviceModule() { if (!gs_pPFModule) { - gs_pPFModule = FX_NEW CFPF_SkiaDeviceModule; + gs_pPFModule = new CFPF_SkiaDeviceModule; } return gs_pPFModule; } @@ -32,10 +32,7 @@ void CFPF_SkiaDeviceModule::Destroy() IFPF_FontMgr* CFPF_SkiaDeviceModule::GetFontMgr() { if (!m_pFontMgr) { - m_pFontMgr = FX_NEW CFPF_SkiaFontMgr; - if (!m_pFontMgr) { - return NULL; - } + m_pFontMgr = new CFPF_SkiaFontMgr; if (!m_pFontMgr->InitFTLibrary()) { delete m_pFontMgr; return NULL; diff --git a/core/src/fxge/android/fx_android_imp.cpp b/core/src/fxge/android/fx_android_imp.cpp index 528877ef89..a1631ab8f0 100644 --- a/core/src/fxge/android/fx_android_imp.cpp +++ b/core/src/fxge/android/fx_android_imp.cpp @@ -14,10 +14,7 @@ void CFX_GEModule::InitPlatform() } IFPF_FontMgr *pFontMgr = pDeviceModule->GetFontMgr(); if (pFontMgr) { - CFX_AndroidFontInfo *pFontInfo = FX_NEW CFX_AndroidFontInfo; - if (!pFontInfo) { - return; - } + CFX_AndroidFontInfo *pFontInfo = new CFX_AndroidFontInfo; pFontInfo->Init(pFontMgr); m_pFontMgr->SetSystemFontInfo(pFontInfo); } -- cgit v1.2.3