summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-01 12:15:00 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-03-01 20:43:46 +0000
commitb4a261855b34b4c8d938118762ae609a34a3ae99 (patch)
tree7b084e874cbf41eec73a3cec949dc810983cc0cf /fpdfsdk/fpdfview.cpp
parentfed39cf4a23341cf9cb5a5b432248b4247022282 (diff)
downloadpdfium-b4a261855b34b4c8d938118762ae609a34a3ae99.tar.xz
Create virtual codec APIs so chrome/fuzzers can link separately
The one step to make an actual concrete class is conditionalized in fpdfview and is unconditional in the fuzzer. Also replace the clumsy C-style callbacks with a delegate interface as long as we are making new interfaces. Change-Id: I733a437483ce5e0c34211cfbbda05105336f55b5 Reviewed-on: https://pdfium-review.googlesource.com/2887 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r--fpdfsdk/fpdfview.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index e1fba8df66..1e7a651aa8 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -44,6 +44,22 @@
#include "xfa/fxbarcode/BC_Library.h"
#endif // PDF_ENABLE_XFA
+#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
+
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#include "core/fxge/cfx_windowsdevice.h"
#endif
@@ -364,6 +380,26 @@ FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) {
pModuleMgr->LoadEmbeddedCNS1CMaps();
pModuleMgr->LoadEmbeddedKorea1CMaps();
+#ifdef PDF_ENABLE_XFA_BMP
+ pModuleMgr->GetCodecModule()->SetBmpModule(
+ pdfium::MakeUnique<CCodec_BmpModule>());
+#endif
+
+#ifdef PDF_ENABLE_XFA_GIF
+ pModuleMgr->GetCodecModule()->SetGifModule(
+ pdfium::MakeUnique<CCodec_GifModule>());
+#endif
+
+#ifdef PDF_ENABLE_XFA_PNG
+ pModuleMgr->GetCodecModule()->SetPngModule(
+ pdfium::MakeUnique<CCodec_PngModule>());
+#endif
+
+#ifdef PDF_ENABLE_XFA_TIFF
+ pModuleMgr->GetCodecModule()->SetTiffModule(
+ pdfium::MakeUnique<CCodec_TiffModule>());
+#endif
+
#ifdef PDF_ENABLE_XFA
FXJSE_Initialize();
BC_Library_Init();