summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/cpdf_modulemgr.cpp41
-rw-r--r--core/fpdfapi/cpdf_modulemgr.h11
2 files changed, 48 insertions, 4 deletions
diff --git a/core/fpdfapi/cpdf_modulemgr.cpp b/core/fpdfapi/cpdf_modulemgr.cpp
index ac28b36663..8e39bdd587 100644
--- a/core/fpdfapi/cpdf_modulemgr.cpp
+++ b/core/fpdfapi/cpdf_modulemgr.cpp
@@ -10,6 +10,22 @@
#include "core/fxcodec/fx_codec.h"
#include "third_party/base/ptr_util.h"
+#ifdef PDF_ENABLE_XFA_BMP
+#include "core/fxcodec/codec/ccodec_bmpmodule.h"
+#endif
+
+#ifdef PDF_ENABLE_XFA_GIF
+#include "core/fxcodec/codec/ccodec_gifmodule.h"
+#endif
+
+#ifdef PDF_ENABLE_XFA_PNG
+#include "core/fxcodec/codec/ccodec_pngmodule.h"
+#endif
+
+#ifdef PDF_ENABLE_XFA_TIFF
+#include "core/fxcodec/codec/ccodec_tiffmodule.h"
+#endif
+
namespace {
CPDF_ModuleMgr* g_pDefaultMgr = nullptr;
@@ -33,6 +49,31 @@ CPDF_ModuleMgr::CPDF_ModuleMgr() : m_pCodecModule(nullptr) {}
CPDF_ModuleMgr::~CPDF_ModuleMgr() {}
+void CPDF_ModuleMgr::LoadEmbeddedMaps() {
+ LoadEmbeddedGB1CMaps();
+ LoadEmbeddedJapan1CMaps();
+ LoadEmbeddedCNS1CMaps();
+ LoadEmbeddedKorea1CMaps();
+}
+
+void CPDF_ModuleMgr::LoadCodecModules() {
+#ifdef PDF_ENABLE_XFA_BMP
+ m_pCodecModule->SetBmpModule(pdfium::MakeUnique<CCodec_BmpModule>());
+#endif
+
+#ifdef PDF_ENABLE_XFA_GIF
+ m_pCodecModule->SetGifModule(pdfium::MakeUnique<CCodec_GifModule>());
+#endif
+
+#ifdef PDF_ENABLE_XFA_PNG
+ m_pCodecModule->SetPngModule(pdfium::MakeUnique<CCodec_PngModule>());
+#endif
+
+#ifdef PDF_ENABLE_XFA_TIFF
+ m_pCodecModule->SetTiffModule(pdfium::MakeUnique<CCodec_TiffModule>());
+#endif
+}
+
void CPDF_ModuleMgr::InitPageModule() {
m_pPageModule = pdfium::MakeUnique<CPDF_PageModule>();
}
diff --git a/core/fpdfapi/cpdf_modulemgr.h b/core/fpdfapi/cpdf_modulemgr.h
index d31ffd5256..898b6ea0bc 100644
--- a/core/fpdfapi/cpdf_modulemgr.h
+++ b/core/fpdfapi/cpdf_modulemgr.h
@@ -52,10 +52,8 @@ class CPDF_ModuleMgr {
return m_pUnsupportInfoAdapter.get();
}
- void LoadEmbeddedGB1CMaps();
- void LoadEmbeddedCNS1CMaps();
- void LoadEmbeddedJapan1CMaps();
- void LoadEmbeddedKorea1CMaps();
+ void LoadEmbeddedMaps();
+ void LoadCodecModules();
CCodec_FaxModule* GetFaxModule();
CCodec_JpegModule* GetJpegModule();
@@ -68,6 +66,11 @@ class CPDF_ModuleMgr {
CPDF_ModuleMgr();
~CPDF_ModuleMgr();
+ void LoadEmbeddedGB1CMaps();
+ void LoadEmbeddedCNS1CMaps();
+ void LoadEmbeddedJapan1CMaps();
+ void LoadEmbeddedKorea1CMaps();
+
CCodec_ModuleMgr* m_pCodecModule;
std::unique_ptr<CPDF_PageModule> m_pPageModule;
std::unique_ptr<CFSDK_UnsupportInfo_Adapter> m_pUnsupportInfoAdapter;