From 7acd8268491ba9724b245b5dc594c8a4deeca9ee Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 19 Sep 2017 14:34:37 -0700 Subject: Forward declare codec modules in fx_codec.h. Change-Id: I020b862619f3f93f71dbb027b9e799d78744f686 Reviewed-on: https://pdfium-review.googlesource.com/14391 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fxcodec/codec/fx_codec.cpp | 33 +++++++++++++++++++++++++++++++++ core/fxcodec/codec/fx_codec_fax.cpp | 2 +- core/fxcodec/codec/fx_codec_flate.cpp | 2 +- core/fxcodec/codec/fx_codec_icc.cpp | 8 +------- core/fxcodec/codec/fx_codec_jpx_opj.cpp | 2 +- 5 files changed, 37 insertions(+), 10 deletions(-) (limited to 'core/fxcodec/codec') diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index 6bcea4b48e..4d094e54fb 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -12,6 +12,13 @@ #include #include +#include "core/fxcodec/codec/ccodec_basicmodule.h" +#include "core/fxcodec/codec/ccodec_faxmodule.h" +#include "core/fxcodec/codec/ccodec_flatemodule.h" +#include "core/fxcodec/codec/ccodec_iccmodule.h" +#include "core/fxcodec/codec/ccodec_jbig2module.h" +#include "core/fxcodec/codec/ccodec_jpegmodule.h" +#include "core/fxcodec/codec/ccodec_jpxmodule.h" #include "core/fxcodec/codec/ccodec_scanlinedecoder.h" #include "core/fxcodec/codec/codec_int.h" #include "core/fxcrt/fx_extension.h" @@ -19,6 +26,13 @@ #include "third_party/base/logging.h" #include "third_party/base/ptr_util.h" +#ifdef PDF_ENABLE_XFA +#include "core/fxcodec/codec/ccodec_bmpmodule.h" +#include "core/fxcodec/codec/ccodec_gifmodule.h" +#include "core/fxcodec/codec/ccodec_pngmodule.h" +#include "core/fxcodec/codec/ccodec_tiffmodule.h" +#endif // PDF_ENABLE_XFA + namespace { const uint8_t g_CMYK[81 * 81 * 3] = { @@ -1350,6 +1364,25 @@ CCodec_ModuleMgr::CCodec_ModuleMgr() CCodec_ModuleMgr::~CCodec_ModuleMgr() {} +#ifdef PDF_ENABLE_XFA +void CCodec_ModuleMgr::SetBmpModule(std::unique_ptr module) { + m_pBmpModule = std::move(module); +} + +void CCodec_ModuleMgr::SetGifModule(std::unique_ptr module) { + m_pGifModule = std::move(module); +} + +void CCodec_ModuleMgr::SetPngModule(std::unique_ptr module) { + m_pPngModule = std::move(module); +} + +void CCodec_ModuleMgr::SetTiffModule( + std::unique_ptr module) { + m_pTiffModule = std::move(module); +} +#endif // PDF_ENABLE_XFA + bool CCodec_BasicModule::RunLengthEncode(const uint8_t* src_buf, uint32_t src_size, uint8_t** dest_buf, diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp index 9cd2cb9a51..9c8eaa25ce 100644 --- a/core/fxcodec/codec/fx_codec_fax.cpp +++ b/core/fxcodec/codec/fx_codec_fax.cpp @@ -8,9 +8,9 @@ #include #include +#include "core/fxcodec/codec/ccodec_faxmodule.h" #include "core/fxcodec/codec/ccodec_scanlinedecoder.h" #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/cfx_binarybuf.h" #include "core/fxcrt/fx_memory.h" #include "third_party/base/ptr_util.h" diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp index 72b20741b5..5b1df38913 100644 --- a/core/fxcodec/codec/fx_codec_flate.cpp +++ b/core/fxcodec/codec/fx_codec_flate.cpp @@ -11,8 +11,8 @@ #include #include +#include "core/fxcodec/codec/ccodec_flatemodule.h" #include "core/fxcodec/codec/ccodec_scanlinedecoder.h" -#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_extension.h" #include "third_party/base/numerics/safe_conversions.h" #include "third_party/base/ptr_util.h" diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp index e17b2e2d00..7f6078a636 100644 --- a/core/fxcodec/codec/fx_codec_icc.cpp +++ b/core/fxcodec/codec/fx_codec_icc.cpp @@ -6,16 +6,10 @@ #include +#include "core/fxcodec/codec/ccodec_iccmodule.h" #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/cfx_fixedbufgrow.h" -#if defined(USE_SYSTEM_LCMS2) -#include -#else -#include "third_party/lcms/include/lcms2.h" -#endif - namespace { bool Check3Components(cmsColorSpaceSignature cs, bool bDst) { diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp index 03f06b872d..b50c01227f 100644 --- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp +++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp @@ -11,8 +11,8 @@ #include #include "core/fpdfapi/page/cpdf_colorspace.h" +#include "core/fxcodec/codec/ccodec_jpxmodule.h" #include "core/fxcodec/codec/cjpx_decoder.h" -#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_safe_types.h" #include "third_party/base/ptr_util.h" -- cgit v1.2.3