summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/fxge/agg/src/fx_agg_driver.cpp25
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.cpp16
-rw-r--r--core/src/fxge/apple/fx_quartz_device.cpp9
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp33
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp6
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp3
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp6
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp12
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp14
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp3
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp6
11 files changed, 3 insertions, 130 deletions
diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
index 2a4d199343..d9783d174b 100644
--- a/core/src/fxge/agg/src/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
@@ -267,9 +267,6 @@ void CFX_AggDeviceDriver::SaveState() {
void* pClip = NULL;
if (m_pClipRgn) {
pClip = new CFX_ClipRgn(*m_pClipRgn);
- if (!pClip) {
- return;
- }
}
m_StateStack.Add(pClip);
}
@@ -321,12 +318,9 @@ FX_BOOL CFX_AggDeviceDriver::SetClip_PathFill(
const CFX_AffineMatrix* pObject2Device,
int fill_mode) {
m_FillFlags = fill_mode;
- if (m_pClipRgn == NULL) {
+ if (!m_pClipRgn) {
m_pClipRgn = new CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH),
GetDeviceCaps(FXDC_PIXEL_HEIGHT));
- if (!m_pClipRgn) {
- return FALSE;
- }
}
if (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) {
CFX_FloatRect rectf;
@@ -356,12 +350,9 @@ FX_BOOL CFX_AggDeviceDriver::SetClip_PathStroke(
const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
- if (m_pClipRgn == NULL) {
+ if (!m_pClipRgn) {
m_pClipRgn = new CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH),
GetDeviceCaps(FXDC_PIXEL_HEIGHT));
- if (!m_pClipRgn) {
- return FALSE;
- }
}
CAgg_PathData path_data;
path_data.BuildPath(pPathData, NULL);
@@ -1745,9 +1736,6 @@ FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource,
return TRUE;
}
CFX_ImageRenderer* pRenderer = new CFX_ImageRenderer;
- if (!pRenderer) {
- return FALSE;
- }
pRenderer->Start(m_pBitmap, m_pClipRgn, pSource, bitmap_alpha, argb, pMatrix,
render_flags, m_bRgbByteOrder, alpha_flag, pIccTransform);
handle = pRenderer;
@@ -1779,9 +1767,6 @@ FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap,
SetBitmap(pBitmap);
IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(
pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
- if (!pDriver) {
- return FALSE;
- }
SetDeviceDriver(pDriver);
return TRUE;
}
@@ -1792,9 +1777,6 @@ FX_BOOL CFX_FxgeDevice::Create(int width,
CFX_DIBitmap* pOriDevice) {
m_bOwnedBitmap = TRUE;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
- if (!pBitmap) {
- return FALSE;
- }
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
return FALSE;
@@ -1802,9 +1784,6 @@ FX_BOOL CFX_FxgeDevice::Create(int width,
SetBitmap(pBitmap);
IFX_RenderDeviceDriver* pDriver =
new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
- if (!pDriver) {
- return FALSE;
- }
SetDeviceDriver(pDriver);
return TRUE;
}
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp
index a7b38b2033..521460bea3 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/src/fxge/android/fpf_skiafontmgr.cpp
@@ -332,23 +332,12 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname,
if (nItem > -1) {
CFPF_SkiaFontDescriptor* pFontDes =
(CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(nItem);
-<<<<<<< HEAD
- CFPF_SkiaFont* pFont = new CFPF_SkiaFont;
- if (pFont) {
- if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) {
- m_FamilyFonts.SetAt((void*)(uintptr_t)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*)(uintptr_t)dwHash, (void*)pFont);
return pFont->Retain();
->>>>>>> bb17868... Use stdint.h types throughout PDFium.
}
- return pFont;
+ pFont->Release()
}
return NULL;
}
@@ -451,9 +440,6 @@ void CFPF_SkiaFontMgr::ScanFile(const CFX_ByteStringC& file) {
FXFT_Face face = GetFontFace(file);
if (face) {
CFPF_SkiaPathFont* pFontDesc = new CFPF_SkiaPathFont;
- if (!pFontDesc) {
- return;
- }
pFontDesc->SetPath(file.GetCStr());
ReportFace(face, pFontDesc);
m_FontFaces.Add(pFontDesc);
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index 0407a5e612..61a0cef543 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -1019,9 +1019,6 @@ FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) {
CGContextRetain(m_pContext);
IFX_RenderDeviceDriver* pDriver =
new CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
- if (!pDriver) {
- return FALSE;
- }
SetDeviceDriver(pDriver);
return TRUE;
}
@@ -1033,9 +1030,6 @@ FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap) {
}
IFX_RenderDeviceDriver* pDriver =
new CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
- if (!pDriver) {
- return FALSE;
- }
SetDeviceDriver(pDriver);
return TRUE;
}
@@ -1046,9 +1040,6 @@ FX_BOOL CFX_QuartzDevice::Create(int32_t width,
return FALSE;
}
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
- if (!pBitmap) {
- return FALSE;
- }
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
return FALSE;
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index d89fec74c4..8c7e831e8c 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -158,9 +158,6 @@ CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const {
}
}
CFX_DIBitmap* pNewBitmap = new CFX_DIBitmap;
- if (!pNewBitmap) {
- return NULL;
- }
if (!pNewBitmap->Create(rect.Width(), rect.Height(), GetFormat())) {
delete pNewBitmap;
return NULL;
@@ -223,9 +220,6 @@ FX_BOOL CFX_DIBSource::BuildAlphaMask() {
return TRUE;
}
m_pAlphaMask = new CFX_DIBitmap;
- if (!m_pAlphaMask) {
- return FALSE;
- }
if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete m_pAlphaMask;
m_pAlphaMask = NULL;
@@ -586,9 +580,6 @@ CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const {
}
}
CFX_DIBitmap* pMask = new CFX_DIBitmap;
- if (!pMask) {
- return NULL;
- }
if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_8bppMask)) {
delete pMask;
return NULL;
@@ -920,9 +911,6 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) {
gray[i] = (uint8_t)FXRGB2GRAY(r, g, b);
}
CFX_DIBitmap* pMask = new CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
return FALSE;
@@ -954,9 +942,6 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) {
gray[i] = (uint8_t)FXRGB2GRAY(r, g, b);
}
CFX_DIBitmap* pMask = new CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
return FALSE;
@@ -974,9 +959,6 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) {
}
case FXDIB_Rgb: {
CFX_DIBitmap* pMask = new CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
return FALSE;
@@ -995,9 +977,6 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) {
}
case FXDIB_Rgb32: {
CFX_DIBitmap* pMask = new CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
return FALSE;
@@ -1438,9 +1417,6 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette,
}
CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const {
CFX_DIBitmap* pFlipped = new CFX_DIBitmap;
- if (!pFlipped) {
- return NULL;
- }
if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
delete pFlipped;
return NULL;
@@ -1516,9 +1492,6 @@ CFX_DIBExtractor::CFX_DIBExtractor(const CFX_DIBSource* pSrc) {
m_pBitmap = pSrc->Clone();
} else {
m_pBitmap = new CFX_DIBitmap;
- if (!m_pBitmap) {
- return;
- }
if (!m_pBitmap->Create(pSrc->GetWidth(), pSrc->GetHeight(),
pSrc->GetFormat(), pSrc->GetBuffer())) {
delete m_pBitmap;
@@ -1632,9 +1605,6 @@ FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice,
}
m_Status = 2;
m_pTransformer = new CFX_ImageTransformer;
- if (!m_pTransformer) {
- return FALSE;
- }
m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox);
return TRUE;
}
@@ -1740,9 +1710,6 @@ FX_BOOL CFX_BitmapStorer::SetInfo(int width,
FXDIB_Format src_format,
FX_DWORD* pSrcPalette) {
m_pBitmap = new CFX_DIBitmap;
- if (!m_pBitmap) {
- return FALSE;
- }
if (!m_pBitmap->Create(width, height, src_format)) {
delete m_pBitmap;
m_pBitmap = NULL;
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index c7c4ed2d3d..aa19c58b05 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -65,9 +65,6 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) {
m_bLogic = TRUE;
if (pFont->m_pSubstFont) {
m_pSubstFont = new CFX_SubstFont;
- if (!m_pSubstFont) {
- return FALSE;
- }
m_pSubstFont->m_Charset = pFont->m_pSubstFont->m_Charset;
m_pSubstFont->m_ExtHandle = pFont->m_pSubstFont->m_ExtHandle;
m_pSubstFont->m_SubstFlags = pFont->m_pSubstFont->m_SubstFlags;
@@ -129,9 +126,6 @@ FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name,
m_bEmbedded = FALSE;
m_bVertical = bVertical;
m_pSubstFont = new CFX_SubstFont;
- if (!m_pSubstFont) {
- return FALSE;
- }
m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(
face_name, bTrueType, flags, weight, italic_angle, CharsetCP,
m_pSubstFont);
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index 34dbde2b2d..dacec0455c 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -571,9 +571,6 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache,
if (m_PSFontList.GetSize() == 0 ||
m_PSFontList[m_PSFontList.GetSize() - 1]->m_nGlyphs == 256) {
CPSFont* pPSFont = new CPSFont;
- if (!pPSFont) {
- return;
- }
pPSFont->m_nGlyphs = 0;
m_PSFontList.Add(pPSFont);
CFX_ByteTextBuf buf;
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 93e3486b79..1bb7bbeeea 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -1577,9 +1577,6 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
}
int dib_width = bmwidth;
CFX_GlyphBitmap* pGlyphBitmap = new CFX_GlyphBitmap;
- if (!pGlyphBitmap) {
- return NULL;
- }
pGlyphBitmap->m_Bitmap.Create(
dib_width, bmheight,
anti_alias == FXFT_RENDER_MODE_MONO ? FXDIB_1bppMask : FXDIB_8bppMask);
@@ -1828,9 +1825,6 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) {
return NULL;
}
CFX_PathData* pPath = new CFX_PathData;
- if (!pPath) {
- return NULL;
- }
pPath->SetPointCount(params.m_PointCount);
params.m_bCount = FALSE;
params.m_PointCount = 0;
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index a0ccb83ae4..2db35f7f68 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -410,9 +410,6 @@ IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) {
}
void CFX_GEModule::InitPlatform() {
CWin32Platform* pPlatformData = new CWin32Platform;
- if (!pPlatformData) {
- return;
- }
OSVERSIONINFO ver;
ver.dwOSVersionInfoSize = sizeof(ver);
GetVersionEx(&ver);
@@ -1254,9 +1251,6 @@ CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC,
m_psLevel = psLevel;
if (bForcePSOutput) {
IFX_RenderDeviceDriver* pDriver = new CPSPrinterDriver;
- if (!pDriver) {
- return;
- }
((CPSPrinterDriver*)pDriver)->Init(hDC, psLevel, bCmykOutput);
SetDeviceDriver(pDriver);
return;
@@ -1303,17 +1297,11 @@ CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width,
return;
}
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
- if (!pBitmap) {
- return;
- }
pBitmap->Create(width, height, format, pBuffer);
SetBitmap(pBitmap);
m_hDC = ::CreateCompatibleDC(NULL);
m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
IFX_RenderDeviceDriver* pDriver = new CGdiDisplayDriver(m_hDC);
- if (!pDriver) {
- return;
- }
SetDeviceDriver(pDriver);
}
CFX_WinBitmapDevice::~CFX_WinBitmapDevice() {
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index f6230f6ce0..b1ffe8080d 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -60,9 +60,6 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi,
}
int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
- if (!pBitmap) {
- return NULL;
- }
FXDIB_Format format = bAlpha
? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200)
: (FXDIB_Format)pbmi->bmiHeader.biBitCount;
@@ -132,10 +129,6 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const FX_WCHAR* filename) {
int width, height;
GetBitmapSize(hBitmap, width, height);
CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
- if (!pDIBitmap) {
- DeleteDC(hDC);
- return NULL;
- }
if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
delete pDIBitmap;
DeleteDC(hDC);
@@ -169,10 +162,6 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) {
int width, height;
GetBitmapSize(hBitmap, width, height);
CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
- if (!pDIBitmap) {
- DeleteDC(hDC);
- return NULL;
- }
if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
delete pDIBitmap;
DeleteDC(hDC);
@@ -205,9 +194,6 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC,
bmih.biHeight = -height;
bmih.biCompression = BI_RGB;
CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
- if (!pDIBitmap) {
- return NULL;
- }
int ret = 0;
if (bmih.biBitCount == 1 || bmih.biBitCount == 8) {
int size = sizeof(BITMAPINFOHEADER) + 8;
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index f4f6d91fbc..845eb14576 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -337,9 +337,6 @@ HRESULT STDMETHODCALLTYPE CDwFontFileLoader::CreateStreamFromKey(
*fontFileStream = NULL;
CDwFontFileStream* stream =
new CDwFontFileStream(fontFileReferenceKey, fontFileReferenceKeySize);
- if (stream == NULL) {
- return E_OUTOFMEMORY;
- }
if (!stream->IsInitialized()) {
delete stream;
return E_FAIL;
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index 9dbc7b4289..ce65a26301 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -476,9 +476,6 @@ static CFX_DIBitmap* _StretchMonoToGray(int dest_width,
int result_height = pClipRect->Height();
int result_pitch = (result_width + 3) / 4 * 4;
CFX_DIBitmap* pStretched = new CFX_DIBitmap;
- if (!pStretched) {
- return NULL;
- }
if (!pStretched->Create(result_width, result_height, FXDIB_8bppRgb)) {
delete pStretched;
return NULL;
@@ -1417,9 +1414,6 @@ static PREVIEW3_DIBITMAP* LoadDIBitmap(WINDIB_Open_Args_ args) {
return NULL;
}
pStream = new GpStream;
- if (!pStream) {
- return NULL;
- }
pStream->Write(args.memory_base, (ULONG)args.memory_size, NULL);
status = CallFunc(GdipCreateBitmapFromStreamICM)(pStream, &pBitmap);
}