From 27924e6c9d43f0eba57d14004853d5a8ba47de26 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 9 May 2018 14:42:42 +0000 Subject: Do not build TIFF when codec is disabled Currently all of the TIFF related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the TIFF codec code if support for TIFF is turned off. It also fixes cases in the code base where tif was being used instead of tiff. BUG=pdfium:1080 Change-Id: If6aaa8af5160fdd5b261e63bab7d5984196efcc9 Reviewed-on: https://pdfium-review.googlesource.com/32193 Commit-Queue: Ryan Harrison Reviewed-by: Tom Sepez --- core/fxcodec/codec/ccodec_progressivedecoder.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 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 a14ec0db29..9a0136c872 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -15,13 +15,17 @@ #include "core/fxcodec/codec/ccodec_gifmodule.h" #include "core/fxcodec/codec/ccodec_jpegmodule.h" #include "core/fxcodec/codec/ccodec_pngmodule.h" -#include "core/fxcodec/codec/ccodec_tiffmodule.h" #include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" +#include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/fx_dib.h" +#ifdef PDF_ENABLE_XFA_TIFF +#include "core/fxcodec/codec/ccodec_tiffmodule.h" +#endif // PDF_ENABLE_XFA_TIFF + class CCodec_ModuleMgr; class CFX_DIBAttribute; class IFX_SeekableReadStream; @@ -167,7 +171,9 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate, bool JpegDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size); bool PngDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size); bool GifDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size); - bool TifDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size); +#ifdef PDF_ENABLE_XFA_TIFF + bool TiffDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size); +#endif // PDF_ENABLE_XFA_TIFF void GetDownScale(int& down_scale); void GetTransMethod(FXDIB_Format dest_format, FXCodec_Format src_format); @@ -199,7 +205,9 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate, FXCODEC_STATUS PngContinueDecode(); FXCODEC_STATUS GifContinueDecode(); FXCODEC_STATUS BmpContinueDecode(); - FXCODEC_STATUS TifContinueDecode(); +#ifdef PDF_ENABLE_XFA_TIFF + FXCODEC_STATUS TiffContinueDecode(); +#endif // PDF_ENABLE_XFA_TIFF RetainPtr m_pFile; RetainPtr m_pDeviceBitmap; @@ -208,7 +216,9 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate, std::unique_ptr m_pPngContext; std::unique_ptr m_pGifContext; std::unique_ptr m_pBmpContext; +#ifdef PDF_ENABLE_XFA_TIFF std::unique_ptr m_pTiffContext; +#endif // PDF_ENABLE_XFA_TIFF FXCODEC_IMAGE_TYPE m_imagType; uint32_t m_offSet; uint8_t* m_pSrcBuf; -- cgit v1.2.3