summaryrefslogtreecommitdiff
path: root/core/fxcodec/fx_codec.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-27 10:12:59 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-27 18:37:42 +0000
commit73c9f3bb3d82563d6d4496c4b0204d5c0825e8a2 (patch)
treebbc3e4e303f5f0a0a2e3931bfde01436130220bb /core/fxcodec/fx_codec.h
parent717a4fc857d66017cecc4c8f8285713135b9dc68 (diff)
downloadpdfium-73c9f3bb3d82563d6d4496c4b0204d5c0825e8a2.tar.xz
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 <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/fx_codec.h')
-rw-r--r--core/fxcodec/fx_codec.h48
1 files changed, 40 insertions, 8 deletions
diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h
index bb4766567b..a33e117c7e 100644
--- a/core/fxcodec/fx_codec.h
+++ b/core/fxcodec/fx_codec.h
@@ -28,12 +28,23 @@ class CJPX_Decoder;
class CPDF_ColorSpace;
class CPDF_StreamAcc;
-#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"
+#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
+#ifdef PDF_ENABLE_XFA
class CCodec_ProgressiveDecoder;
class CFX_DIBAttribute {
@@ -71,11 +82,23 @@ class CCodec_ModuleMgr {
#ifdef PDF_ENABLE_XFA
CCodec_ProgressiveDecoder* CreateProgressiveDecoder();
- CCodec_PngModule* GetPngModule() const { return m_pPngModule.get(); }
- CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); }
+#endif // PDF_ENABLE_XFA
+
+#ifdef PDF_ENABLE_XFA_BMP
CCodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); }
+#endif // PDF_ENABLE_XFA_BMP
+
+#ifdef PDF_ENABLE_XFA_GIF
+ CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); }
+#endif // PDF_ENABLE_XFA_GIF
+
+#ifdef PDF_ENABLE_XFA_PNG
+ CCodec_PngModule* GetPngModule() const { return m_pPngModule.get(); }
+#endif // PDF_ENABLE_XFA_PNG
+
+#ifdef PDF_ENABLE_XFA_TIFF
CCodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); }
-#endif // PDF_ENABLE_XFA
+#endif // PDF_ENABLE_XFA_TIFF
protected:
std::unique_ptr<CCodec_BasicModule> m_pBasicModule;
@@ -85,12 +108,21 @@ class CCodec_ModuleMgr {
std::unique_ptr<CCodec_Jbig2Module> m_pJbig2Module;
std::unique_ptr<CCodec_IccModule> m_pIccModule;
-#ifdef PDF_ENABLE_XFA
- std::unique_ptr<CCodec_PngModule> m_pPngModule;
- std::unique_ptr<CCodec_GifModule> m_pGifModule;
+#ifdef PDF_ENABLE_XFA_BMP
std::unique_ptr<CCodec_BmpModule> m_pBmpModule;
+#endif // PDF_ENABLE_XFA_BMP
+
+#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
+#endif // PDF_ENABLE_XFA_TIFF
std::unique_ptr<CCodec_FlateModule> m_pFlateModule;
};