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

Side by Side Diff: core/src/fxcodec/codec/fx_codec_jpeg.cpp

Issue 1084303002: Replace FX_NEW with new, remote tests from fxcodec (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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/fxcodec/codec/fx_codec_jbig.cpp ('k') | core/src/fxcodec/codec/fx_codec_jpx_opj.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/fxcodec/fx_codec.h" 7 #include "../../../include/fxcodec/fx_codec.h"
8 #include "../../../include/fxge/fx_dib.h" 8 #include "../../../include/fxge/fx_dib.h"
9 #include "codec_int.h" 9 #include "codec_int.h"
10 extern "C" { 10 extern "C" {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 return m_pExtProvider->GetSrcOffset(m_pExtContext); 477 return m_pExtProvider->GetSrcOffset(m_pExtContext);
478 } 478 }
479 return (FX_DWORD)(m_SrcSize - src.bytes_in_buffer); 479 return (FX_DWORD)(m_SrcSize - src.bytes_in_buffer);
480 } 480 }
481 ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(FX_LPCBYTE src_buf, FX_ DWORD src_size, 481 ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(FX_LPCBYTE src_buf, FX_ DWORD src_size,
482 int width, int height, int nComps, FX_BOOL ColorTransform) 482 int width, int height, int nComps, FX_BOOL ColorTransform)
483 { 483 {
484 if (src_buf == NULL || src_size == 0) { 484 if (src_buf == NULL || src_size == 0) {
485 return NULL; 485 return NULL;
486 } 486 }
487 CCodec_JpegDecoder* pDecoder = FX_NEW CCodec_JpegDecoder; 487 CCodec_JpegDecoder* pDecoder = new CCodec_JpegDecoder;
488 if (pDecoder == NULL) {
489 return NULL;
490 }
491 if (!pDecoder->Create(src_buf, src_size, width, height, nComps, ColorTransfo rm, m_pExtProvider)) { 488 if (!pDecoder->Create(src_buf, src_size, width, height, nComps, ColorTransfo rm, m_pExtProvider)) {
492 delete pDecoder; 489 delete pDecoder;
493 return NULL; 490 return NULL;
494 } 491 }
495 return pDecoder; 492 return pDecoder;
496 } 493 }
497 FX_BOOL CCodec_JpegModule::LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height, 494 FX_BOOL CCodec_JpegModule::LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
498 int& num_components, int& bits_per_component s, FX_BOOL& color_transform, 495 int& num_components, int& bits_per_component s, FX_BOOL& color_transform,
499 FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length ) 496 FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length )
500 { 497 {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr); 661 return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr);
665 } 662 }
666 if(avail_buf_ptr != NULL) { 663 if(avail_buf_ptr != NULL) {
667 *avail_buf_ptr = NULL; 664 *avail_buf_ptr = NULL;
668 if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) { 665 if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) {
669 *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.ne xt_input_byte; 666 *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.ne xt_input_byte;
670 } 667 }
671 } 668 }
672 return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer; 669 return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer;
673 } 670 }
OLDNEW
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_jbig.cpp ('k') | core/src/fxcodec/codec/fx_codec_jpx_opj.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698