From 95061379c9453b941783398826acff674d2bbfd7 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 10 May 2018 16:38:15 +0000 Subject: Do not build BMP when codec is disabled Currently all of the BMP 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 BMP codec code if support for BMP is turned off. BUG=pdfium:1080 Change-Id: I56d40639a5a3631f9c601a1eef3f98873feac94f Reviewed-on: https://pdfium-review.googlesource.com/32370 Commit-Queue: Ryan Harrison Reviewed-by: dsinclair --- core/fxcodec/fx_codec.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'core/fxcodec/fx_codec.h') diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h index b5e8d8ad39..91d9f2fb32 100644 --- a/core/fxcodec/fx_codec.h +++ b/core/fxcodec/fx_codec.h @@ -19,7 +19,9 @@ #include "core/fxcrt/fx_string.h" #ifdef PDF_ENABLE_XFA +#ifdef PDF_ENABLE_XFA_BMP #include "core/fxcodec/codec/ccodec_bmpmodule.h" +#endif // PDF_ENABLE_XFA_BMP #ifdef PDF_ENABLE_XFA_GIF #include "core/fxcodec/codec/ccodec_gifmodule.h" @@ -54,17 +56,20 @@ class CFX_DIBAttribute { CFX_DIBAttribute(); ~CFX_DIBAttribute(); - int32_t m_nXDPI; - int32_t m_nYDPI; - float m_fAspectRatio; - uint16_t m_wDPIUnit; +#ifdef PDF_ENABLE_XFA_BMP + int32_t m_nBmpCompressType; +#endif // PDF_ENABLE_XFA_BMP #ifdef PDF_ENABLE_XFA_GIF int32_t m_nGifLeft; int32_t m_nGifTop; uint32_t* m_pGifLocalPalette; uint32_t m_nGifLocalPalNum; #endif // PDF_ENABLE_XFA_GIF - int32_t m_nBmpCompressType; + + int32_t m_nXDPI; + int32_t m_nYDPI; + float m_fAspectRatio; + uint16_t m_wDPIUnit; std::map m_Exif; }; #endif // PDF_ENABLE_XFA @@ -84,10 +89,13 @@ class CCodec_ModuleMgr { #ifdef PDF_ENABLE_XFA std::unique_ptr CreateProgressiveDecoder(); + +#ifdef PDF_ENABLE_XFA_BMP CCodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } void SetBmpModule(std::unique_ptr module) { m_pBmpModule = std::move(module); } +#endif // PDF_ENABLE_XFA_BMP #ifdef PDF_ENABLE_XFA_GIF CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } @@ -120,7 +128,9 @@ class CCodec_ModuleMgr { std::unique_ptr m_pIccModule; #ifdef PDF_ENABLE_XFA +#ifdef PDF_ENABLE_XFA_BMP std::unique_ptr m_pBmpModule; +#endif // PDF_ENABLE_XFA_BMP #ifdef PDF_ENABLE_XFA_GIF std::unique_ptr m_pGifModule; -- cgit v1.2.3