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

Unified Diff: core/src/fxge/win32/fx_win32_dib.cpp

Issue 1062863006: Remove checks in fxge/{apple,win32,skia,dib} now that FX_NEW cant return 0 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix missing |new| 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | core/src/fxge/win32/fx_win32_dwrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/win32/fx_win32_dib.cpp
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index 2ecf539ff715af1764a07a1606eb82288449fc6b..ec523c39c1dba6c2184d6249e70b2385c4b6b89f 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -59,10 +59,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL
bBottomUp = FALSE;
}
int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- if (!pBitmap) {
- return NULL;
- }
+ CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
FXDIB_Format format = bAlpha ? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200) : (FXDIB_Format)pbmi->bmiHeader.biBitCount;
FX_BOOL ret = pBitmap->Create(width, height, format);
if (!ret) {
@@ -135,11 +132,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(FX_LPCWSTR filename)
HDC hDC = CreateCompatibleDC(NULL);
int width, height;
GetBitmapSize(hBitmap, width, height);
- CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
- if (!pDIBitmap) {
- DeleteDC(hDC);
- return NULL;
- }
+ CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
delete pDIBitmap;
DeleteDC(hDC);
@@ -171,11 +164,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args)
HDC hDC = CreateCompatibleDC(NULL);
int width, height;
GetBitmapSize(hBitmap, width, height);
- CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
- if (!pDIBitmap) {
- DeleteDC(hDC);
- return NULL;
- }
+ CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
delete pDIBitmap;
DeleteDC(hDC);
@@ -206,10 +195,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP
int height = abs(bmih.biHeight);
bmih.biHeight = -height;
bmih.biCompression = BI_RGB;
- CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
- if (!pDIBitmap) {
- return NULL;
- }
+ CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
int ret = 0;
if (bmih.biBitCount == 1 || bmih.biBitCount == 8) {
int size = sizeof (BITMAPINFOHEADER) + 8;
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | core/src/fxge/win32/fx_win32_dwrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698