From 2c4104443f5a7aea225bd853770cdc11ab431932 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 6 May 2015 15:09:06 -0700 Subject: Merge to XFA: Replace FX_NEW with new, remote tests from fxcodec Review URL: https://codereview.chromium.org/1084303002 (cherry picked from commit cfc1a654ef3e8b65bc447815d35932c185bf1422) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1125363002 --- core/src/fxcodec/codec/fx_codec_progress.cpp | 37 +++++----------------------- 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'core/src/fxcodec/codec/fx_codec_progress.cpp') diff --git a/core/src/fxcodec/codec/fx_codec_progress.cpp b/core/src/fxcodec/codec/fx_codec_progress.cpp index 542ac681e6..0a51a9d437 100644 --- a/core/src/fxcodec/codec/fx_codec_progress.cpp +++ b/core/src/fxcodec/codec/fx_codec_progress.cpp @@ -2110,12 +2110,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) } return m_status = FXCODEC_STATUS_DECODE_FINISH; } else { - CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap; - if(pDIBitmap == NULL) { - m_pDeviceBitmap = NULL; - m_pFile = NULL; - return m_status = FXCODEC_STATUS_ERR_MEMORY; - } + CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap; pDIBitmap->Create(m_SrcWidth, m_SrcHeight, FXDIB_Argb); if(pDIBitmap->GetBuffer() == NULL) { delete pDIBitmap; @@ -2146,39 +2141,19 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) CFX_DIBitmap* pFormatBitmap = NULL; switch(m_pDeviceBitmap->GetFormat()) { case FXDIB_8bppRgb: - pFormatBitmap = FX_NEW CFX_DIBitmap; - if(pFormatBitmap == NULL) { - m_pDeviceBitmap = NULL; - m_pFile = NULL; - return m_status = FXCODEC_STATUS_ERR_MEMORY; - } + pFormatBitmap = new CFX_DIBitmap; pFormatBitmap->Create(pClipBitmap->GetWidth(), pClipBitmap->GetHeight(), FXDIB_8bppRgb); break; case FXDIB_8bppMask: - pFormatBitmap = FX_NEW CFX_DIBitmap; - if(pFormatBitmap == NULL) { - m_pDeviceBitmap = NULL; - m_pFile = NULL; - return m_status = FXCODEC_STATUS_ERR_MEMORY; - } + pFormatBitmap = new CFX_DIBitmap; pFormatBitmap->Create(pClipBitmap->GetWidth(), pClipBitmap->GetHeight(), FXDIB_8bppMask); break; case FXDIB_Rgb: - pFormatBitmap = FX_NEW CFX_DIBitmap; - if(pFormatBitmap == NULL) { - m_pDeviceBitmap = NULL; - m_pFile = NULL; - return m_status = FXCODEC_STATUS_ERR_MEMORY; - } + pFormatBitmap = new CFX_DIBitmap; pFormatBitmap->Create(pClipBitmap->GetWidth(), pClipBitmap->GetHeight(), FXDIB_Rgb); break; case FXDIB_Rgb32: - pFormatBitmap = FX_NEW CFX_DIBitmap; - if(pFormatBitmap == NULL) { - m_pDeviceBitmap = NULL; - m_pFile = NULL; - return m_status = FXCODEC_STATUS_ERR_MEMORY; - } + pFormatBitmap = new CFX_DIBitmap; pFormatBitmap->Create(pClipBitmap->GetWidth(), pClipBitmap->GetHeight(), FXDIB_Rgb32); break; case FXDIB_Argb: @@ -2259,5 +2234,5 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) } ICodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() { - return FX_NEW CCodec_ProgressiveDecoder(this); + return new CCodec_ProgressiveDecoder(this); } -- cgit v1.2.3