diff options
author | Lei Zhang <thestig@chromium.org> | 2017-09-19 14:34:37 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-20 01:29:52 +0000 |
commit | 7acd8268491ba9724b245b5dc594c8a4deeca9ee (patch) | |
tree | 6a24497b4ce6115c0a08eb71022b46d9318ac722 | |
parent | 4b8d363ceed5437ee6a23563f69ba0a73d90413c (diff) | |
download | pdfium-7acd8268491ba9724b245b5dc594c8a4deeca9ee.tar.xz |
Forward declare codec modules in fx_codec.h.
Change-Id: I020b862619f3f93f71dbb027b9e799d78744f686
Reviewed-on: https://pdfium-review.googlesource.com/14391
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | core/fpdfapi/page/cpdf_image.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_streamparser.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/parser/fpdf_parser_decode.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_dibsource.cpp | 4 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec.cpp | 33 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec_fax.cpp | 2 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec_flate.cpp | 2 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec_icc.cpp | 8 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec_jpx_opj.cpp | 2 | ||||
-rw-r--r-- | core/fxcodec/fx_codec.h | 44 | ||||
-rw-r--r-- | core/fxge/win32/cfx_psrenderer.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_localemgr.cpp | 1 |
12 files changed, 67 insertions, 39 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp index 6e8c0e13c0..f748b6950d 100644 --- a/core/fpdfapi/page/cpdf_image.cpp +++ b/core/fpdfapi/page/cpdf_image.cpp @@ -24,7 +24,7 @@ #include "core/fpdfapi/parser/cpdf_string.h" #include "core/fpdfapi/render/cpdf_dibsource.h" #include "core/fpdfapi/render/cpdf_pagerendercache.h" -#include "core/fxcodec/fx_codec.h" +#include "core/fxcodec/codec/ccodec_jpegmodule.h" #include "core/fxcrt/fx_stream.h" #include "core/fxge/fx_dib.h" #include "third_party/base/numerics/safe_conversions.h" diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp index 526f09757d..ffd76005e0 100644 --- a/core/fpdfapi/page/cpdf_streamparser.cpp +++ b/core/fpdfapi/page/cpdf_streamparser.cpp @@ -26,8 +26,8 @@ #include "core/fpdfapi/parser/cpdf_string.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fpdfapi/parser/fpdf_parser_utility.h" +#include "core/fxcodec/codec/ccodec_jpegmodule.h" #include "core/fxcodec/codec/ccodec_scanlinedecoder.h" -#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_extension.h" namespace { diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp index 2c5cb78f43..228c012e5f 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode.cpp +++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp @@ -17,6 +17,8 @@ #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/fpdf_parser_utility.h" +#include "core/fxcodec/codec/ccodec_faxmodule.h" +#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" diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp index 9764d51b65..c6a5632055 100644 --- a/core/fpdfapi/render/cpdf_dibsource.cpp +++ b/core/fpdfapi/render/cpdf_dibsource.cpp @@ -21,6 +21,10 @@ #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fpdfapi/render/cpdf_pagerendercache.h" #include "core/fpdfapi/render/cpdf_renderstatus.h" +#include "core/fxcodec/codec/ccodec_basicmodule.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/cjpx_decoder.h" #include "core/fxcodec/fx_codec.h" 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 <tuple> #include <utility> +#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<CCodec_BmpModule> module) { + m_pBmpModule = std::move(module); +} + +void CCodec_ModuleMgr::SetGifModule(std::unique_ptr<CCodec_GifModule> module) { + m_pGifModule = std::move(module); +} + +void CCodec_ModuleMgr::SetPngModule(std::unique_ptr<CCodec_PngModule> module) { + m_pPngModule = std::move(module); +} + +void CCodec_ModuleMgr::SetTiffModule( + std::unique_ptr<CCodec_TiffModule> 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 <memory> #include <vector> +#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 <utility> #include <vector> +#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 <memory> +#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 <lcms2.h> -#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 <vector> #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" diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h index 269cd14253..0a6d836ddd 100644 --- a/core/fxcodec/fx_codec.h +++ b/core/fxcodec/fx_codec.h @@ -13,30 +13,28 @@ #include <utility> #include <vector> -#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/fx_codec_def.h" #include "core/fxcrt/fx_coordinates.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 - +#include "core/fxcrt/fx_string.h" + +class CCodec_BasicModule; +class CCodec_FaxModule; +class CCodec_FlateModule; +class CCodec_IccModule; +class CCodec_Jbig2Module; +class CCodec_JpegModule; +class CCodec_JpxModule; class CFX_DIBSource; class CJPX_Decoder; 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: @@ -72,18 +70,10 @@ class CCodec_ModuleMgr { #ifdef PDF_ENABLE_XFA std::unique_ptr<CCodec_ProgressiveDecoder> CreateProgressiveDecoder(); - void SetBmpModule(std::unique_ptr<CCodec_BmpModule> module) { - m_pBmpModule = std::move(module); - } - void SetGifModule(std::unique_ptr<CCodec_GifModule> module) { - m_pGifModule = std::move(module); - } - void SetPngModule(std::unique_ptr<CCodec_PngModule> module) { - m_pPngModule = std::move(module); - } - void SetTiffModule(std::unique_ptr<CCodec_TiffModule> module) { - m_pTiffModule = std::move(module); - } + 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(); } CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } CCodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 5586d9f921..651088602e 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -10,6 +10,10 @@ #include <sstream> #include "core/fpdfapi/cpdf_modulemgr.h" +#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_jpegmodule.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/cfx_maybe_owned.h" #include "core/fxge/cfx_facecache.h" diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp index 5d74c9bf47..d05750a4df 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.cpp +++ b/xfa/fxfa/parser/cxfa_localemgr.cpp @@ -12,6 +12,7 @@ #include <utility> #include "core/fpdfapi/cpdf_modulemgr.h" +#include "core/fxcodec/codec/ccodec_flatemodule.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/xml/cxml_element.h" #include "third_party/base/ptr_util.h" |