From 73c9f3bb3d82563d6d4496c4b0204d5c0825e8a2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Feb 2017 10:12:59 -0800 Subject: Allow building XFA without additional codecs. This is something we'd like to try for initial XFA launches adding in codecs as justified by results in the wild. Adding statistics for the unsupported cases is a follow-up exercise once this builds correctly. We always build all the additional libraries, to allow fuzzers to link against them even if we are not shipping them. The linker will sort it out for the actual code. Rename some files to match the classes contained within. That the existing tests seem to pass with the codecs disabled warrants further investigation. Change-Id: Iad269db91289f12dc9f5dda8f48121d27a0c4367 Reviewed-on: https://pdfium-review.googlesource.com/2836 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- core/fxcodec/codec/ccodec_progressivedecoder.h | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h') diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h index 614146f79d..e97d1b9f78 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -171,6 +171,7 @@ class CCodec_ProgressiveDecoder { FXCODEC_STATUS m_status; protected: +#ifdef PDF_ENABLE_XFA_PNG static bool PngReadHeaderFunc(void* pModule, int width, int height, @@ -182,6 +183,9 @@ class CCodec_ProgressiveDecoder { static void PngFillScanlineBufCompletedFunc(void* pModule, int pass, int line); +#endif // PDF_ENABLE_XFA_PNG + +#ifdef PDF_ENABLE_XFA_GIF static void GifRecordCurrentPositionCallback(void* pModule, uint32_t& cur_pos); static uint8_t* GifAskLocalPaletteBufCallback(void* pModule, @@ -200,10 +204,25 @@ class CCodec_ProgressiveDecoder { static void GifReadScanlineCallback(void* pModule, int32_t row_num, uint8_t* row_buf); + bool GifReadMoreData(CCodec_GifModule* pGifModule, + FXCODEC_STATUS& err_status); + void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, + double scale_y, + int des_row); +#endif // PDF_ENABLE_XFA_GIF + +#ifdef PDF_ENABLE_XFA_BMP static bool BmpInputImagePositionBufCallback(void* pModule, uint32_t rcd_pos); static void BmpReadScanlineCallback(void* pModule, int32_t row_num, uint8_t* row_buf); + void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, + int32_t des_line, + uint8_t* src_scan, + FXCodec_Format src_format); + bool BmpReadMoreData(CCodec_BmpModule* pBmpModule, + FXCODEC_STATUS& err_status); +#endif // PDF_ENABLE_XFA_BMP bool DetectImageType(FXCODEC_IMAGE_TYPE imageType, CFX_DIBAttribute* pAttribute); @@ -220,17 +239,6 @@ class CCodec_ProgressiveDecoder { void ResampleVert(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); bool JpegReadMoreData(CCodec_JpegModule* pJpegModule, FXCODEC_STATUS& err_status); - void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, - int32_t des_line, - uint8_t* src_scan, - FXCodec_Format src_format); - bool GifReadMoreData(CCodec_GifModule* pGifModule, - FXCODEC_STATUS& err_status); - void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, - double scale_y, - int des_row); - bool BmpReadMoreData(CCodec_BmpModule* pBmpModule, - FXCODEC_STATUS& err_status); void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); }; -- cgit v1.2.3