summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 12:15:38 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 12:15:38 -0800
commit5c4c193fd4b6dd0657abf5e74125f9887f91d720 (patch)
tree976cfb53dd2580eff58fb02556d1828fff12659d /core/src/fxcodec/codec
parent8b90ee66872aa883fc46ac2b6e7acad35c7c96c6 (diff)
downloadpdfium-5c4c193fd4b6dd0657abf5e74125f9887f91d720.tar.xz
Inflict PPDF_ENABLE_XFA ifdefs on XFA core/
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1471323004 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r--core/src/fxcodec/codec/codec_int.h8
-rw-r--r--core/src/fxcodec/codec/fx_codec.cpp10
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpeg.cpp8
3 files changed, 25 insertions, 1 deletions
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index 3d2acaf8c0..5abe2e4a6a 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -187,15 +187,20 @@ class CCodec_JpegModule : public ICodec_JpegModule {
void Input(void* pContext,
const uint8_t* src_buf,
FX_DWORD src_size) override;
+#ifndef PDF_ENABLE_XFA
+ int ReadHeader(void* pContext, int* width, int* height, int* nComps) override;
+#else
int ReadHeader(void* pContext,
int* width,
int* height,
int* nComps,
CFX_DIBAttribute* pAttribute) override;
+#endif
int StartScanline(void* pContext, int down_scale) override;
FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) override;
FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override;
};
+#ifdef PDF_ENABLE_XFA
#define PNG_ERROR_SIZE 256
class CCodec_PngModule : public ICodec_PngModule {
public:
@@ -258,6 +263,7 @@ class CCodec_BmpModule : public ICodec_BmpModule {
protected:
FX_CHAR m_szLastError[256];
};
+#endif
class CCodec_IccModule : public ICodec_IccModule {
public:
~CCodec_IccModule() override;
@@ -336,6 +342,7 @@ class CCodec_JpxModule : public ICodec_JpxModule {
void DestroyDecoder(CJPX_Decoder* pDecoder) override;
};
+#ifdef PDF_ENABLE_XFA
class CCodec_TiffModule : public ICodec_TiffModule {
public:
// ICodec_TiffModule
@@ -355,6 +362,7 @@ class CCodec_TiffModule : public ICodec_TiffModule {
~CCodec_TiffModule() override {}
};
+#endif
class CCodec_Jbig2Context {
public:
CCodec_Jbig2Context();
diff --git a/core/src/fxcodec/codec/fx_codec.cpp b/core/src/fxcodec/codec/fx_codec.cpp
index 1efccf9af5..fb98fee3c5 100644
--- a/core/src/fxcodec/codec/fx_codec.cpp
+++ b/core/src/fxcodec/codec/fx_codec.cpp
@@ -21,11 +21,17 @@ CCodec_ModuleMgr::CCodec_ModuleMgr()
m_pJpxModule(new CCodec_JpxModule),
m_pJbig2Module(new CCodec_Jbig2Module),
m_pIccModule(new CCodec_IccModule),
+#ifndef PDF_ENABLE_XFA
+ m_pFlateModule(new CCodec_FlateModule) {
+}
+#else
m_pFlateModule(new CCodec_FlateModule),
m_pPngModule(new CCodec_PngModule),
m_pGifModule(new CCodec_GifModule),
m_pBmpModule(new CCodec_BmpModule),
- m_pTiffModule(new CCodec_TiffModule) {}
+ m_pTiffModule(new CCodec_TiffModule) {
+}
+#endif
CCodec_ScanlineDecoder::ImageDataCache::ImageDataCache(int width,
int height,
@@ -261,6 +267,7 @@ FX_BOOL CCodec_BasicModule::A85Encode(const uint8_t* src_buf,
FX_DWORD& dest_size) {
return FALSE;
}
+#ifdef PDF_ENABLE_XFA
CFX_DIBAttribute::CFX_DIBAttribute()
: m_nXDPI(-1),
m_nYDPI(-1),
@@ -278,6 +285,7 @@ CFX_DIBAttribute::~CFX_DIBAttribute() {
FX_Free(pair.second);
}
+#endif
class CCodec_RLScanlineDecoder : public CCodec_ScanlineDecoder {
public:
CCodec_RLScanlineDecoder();
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index b59deb5a0d..b5eb4b2692 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -230,6 +230,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource,
FX_Free(line_buf);
dest_size = dest_buf_length - (FX_STRSIZE)dest.free_in_buffer;
}
+#ifdef PDF_ENABLE_XFA
static void _JpegLoadAttribute(struct jpeg_decompress_struct* pInfo,
CFX_DIBAttribute* pAttribute) {
if (pInfo == NULL || pAttribute == NULL) {
@@ -241,6 +242,7 @@ static void _JpegLoadAttribute(struct jpeg_decompress_struct* pInfo,
pAttribute->m_wDPIUnit = pInfo->density_unit;
}
}
+#endif
static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf,
FX_DWORD src_size,
int& width,
@@ -630,8 +632,12 @@ void CCodec_JpegModule::Input(void* pContext,
int CCodec_JpegModule::ReadHeader(void* pContext,
int* width,
int* height,
+#ifndef PDF_ENABLE_XFA
+ int* nComps) {
+#else
int* nComps,
CFX_DIBAttribute* pAttribute) {
+#endif
FXJPEG_Context* p = (FXJPEG_Context*)pContext;
if (setjmp(p->m_JumpMark) == -1) {
return 1;
@@ -646,7 +652,9 @@ int CCodec_JpegModule::ReadHeader(void* pContext,
*width = p->m_Info.image_width;
*height = p->m_Info.image_height;
*nComps = p->m_Info.num_components;
+#ifdef PDF_ENABLE_XFA
_JpegLoadAttribute(&p->m_Info, pAttribute);
+#endif
return 0;
}
int CCodec_JpegModule::StartScanline(void* pContext, int down_scale) {