diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-05-09 21:06:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-09 21:06:22 +0000 |
commit | 607f3cd63a314cd3a6c219b19cce31805b66cd6d (patch) | |
tree | 74c9bff427b4c8f4697ee28b17bbebe2be411cb2 /core/fxcodec/fx_codec.h | |
parent | d5d48457dabbe71e7f6b0baf2eaea6aa0dc86736 (diff) | |
download | pdfium-607f3cd63a314cd3a6c219b19cce31805b66cd6d.tar.xz |
Do not build GIF when codec is disabled
Currently all of the GIF 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 GIF codec code if support
for GIF is turned off.
This also catches a few missed cases from previous CLs.
BUG=pdfium:1080
Change-Id: Ie7fe2d894d2ae2f8f36ae05e0ff256f2ce6ef8d4
Reviewed-on: https://pdfium-review.googlesource.com/32330
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcodec/fx_codec.h')
-rw-r--r-- | core/fxcodec/fx_codec.h | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h index 5ed29d4da5..b5e8d8ad39 100644 --- a/core/fxcodec/fx_codec.h +++ b/core/fxcodec/fx_codec.h @@ -18,6 +18,22 @@ #include "core/fxcrt/fx_safe_types.h" #include "core/fxcrt/fx_string.h" +#ifdef PDF_ENABLE_XFA +#include "core/fxcodec/codec/ccodec_bmpmodule.h" + +#ifdef PDF_ENABLE_XFA_GIF +#include "core/fxcodec/codec/ccodec_gifmodule.h" +#endif // PDF_ENABLE_XFA_GIF + +#ifdef PDF_ENABLE_XFA_PNG +#include "core/fxcodec/codec/ccodec_pngmodule.h" +#endif // PDF_ENABLE_XFA_PNG + +#ifdef PDF_ENABLE_XFA_TIFF +#include "core/fxcodec/codec/ccodec_tiffmodule.h" +#endif // PDF_ENABLE_XFA_TIFF +#endif // PDF_ENABLE_XFA + class CCodec_BasicModule; class CCodec_FaxModule; class CCodec_FlateModule; @@ -31,11 +47,7 @@ class CPDF_ColorSpace; class CPDF_StreamAcc; #ifdef PDF_ENABLE_XFA -class CCodec_BmpModule; -class CCodec_GifModule; -class CCodec_PngModule; class CCodec_ProgressiveDecoder; -class CCodec_TiffModule; class CFX_DIBAttribute { public: @@ -46,10 +58,12 @@ class CFX_DIBAttribute { int32_t m_nYDPI; float m_fAspectRatio; uint16_t m_wDPIUnit; +#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; std::map<uint32_t, void*> m_Exif; }; @@ -70,14 +84,31 @@ class CCodec_ModuleMgr { #ifdef PDF_ENABLE_XFA std::unique_ptr<CCodec_ProgressiveDecoder> CreateProgressiveDecoder(); - void SetBmpModule(std::unique_ptr<CCodec_BmpModule> module); - void SetGifModule(std::unique_ptr<CCodec_GifModule> module); - void SetPngModule(std::unique_ptr<CCodec_PngModule> module); - void SetTiffModule(std::unique_ptr<CCodec_TiffModule> module); CCodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } + void SetBmpModule(std::unique_ptr<CCodec_BmpModule> module) { + m_pBmpModule = std::move(module); + } + +#ifdef PDF_ENABLE_XFA_GIF CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } + void SetGifModule(std::unique_ptr<CCodec_GifModule> module) { + m_pGifModule = std::move(module); + } +#endif // PDF_ENABLE_XFA_GIF + +#ifdef PDF_ENABLE_XFA_PNG CCodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } + void SetPngModule(std::unique_ptr<CCodec_PngModule> module) { + m_pPngModule = std::move(module); + } +#endif // PDF_ENABLE_XFA_PNG + +#ifdef PDF_ENABLE_XFA_TIFF CCodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); } + void SetTiffModule(std::unique_ptr<CCodec_TiffModule> module) { + m_pTiffModule = std::move(module); + } +#endif // PDF_ENABLE_XFA_TIFF #endif // PDF_ENABLE_XFA protected: @@ -90,9 +121,18 @@ class CCodec_ModuleMgr { #ifdef PDF_ENABLE_XFA std::unique_ptr<CCodec_BmpModule> m_pBmpModule; + +#ifdef PDF_ENABLE_XFA_GIF std::unique_ptr<CCodec_GifModule> m_pGifModule; +#endif // PDF_ENABLE_XFA_GIF + +#ifdef PDF_ENABLE_XFA_PNG std::unique_ptr<CCodec_PngModule> m_pPngModule; +#endif // PDF_ENABLE_XFA_PNG + +#ifdef PDF_ENABLE_XFA_TIFF std::unique_ptr<CCodec_TiffModule> m_pTiffModule; +#endif // PDF_ENABLE_XFA_TIFF #endif // PDF_ENABLE_XFA std::unique_ptr<CCodec_FlateModule> m_pFlateModule; |