summaryrefslogtreecommitdiff
path: root/core/src/fxcodec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 15:52:28 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 15:52:28 -0800
commita2c42ce6150c4072613a6fc9fa0dc064dbf0a15d (patch)
treeb1705df8ed8c9f2f8db5095fbb6e19548493eacd /core/src/fxcodec
parent214947de80a9be2ddb134b1962affc82e20563c9 (diff)
downloadpdfium-a2c42ce6150c4072613a6fc9fa0dc064dbf0a15d.tar.xz
Manual fixups to PDF_ENABLE_XFA in core/
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1477663003 .
Diffstat (limited to 'core/src/fxcodec')
-rw-r--r--core/src/fxcodec/codec/codec_int.h10
-rw-r--r--core/src/fxcodec/codec/fx_codec.cpp14
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpeg.cpp16
3 files changed, 23 insertions, 17 deletions
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index 5abe2e4a6a..7d440d0b61 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -189,17 +189,18 @@ class CCodec_JpegModule : public ICodec_JpegModule {
FX_DWORD src_size) override;
#ifndef PDF_ENABLE_XFA
int ReadHeader(void* pContext, int* width, int* height, int* nComps) override;
-#else
+#else // PDF_ENABLE_XFA
int ReadHeader(void* pContext,
int* width,
int* height,
int* nComps,
CFX_DIBAttribute* pAttribute) override;
-#endif
+#endif // PDF_ENABLE_XFA
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 {
@@ -263,7 +264,8 @@ class CCodec_BmpModule : public ICodec_BmpModule {
protected:
FX_CHAR m_szLastError[256];
};
-#endif
+#endif // PDF_ENABLE_XFA
+
class CCodec_IccModule : public ICodec_IccModule {
public:
~CCodec_IccModule() override;
@@ -361,8 +363,8 @@ class CCodec_TiffModule : public ICodec_TiffModule {
protected:
~CCodec_TiffModule() override {}
};
+#endif // PDF_ENABLE_XFA
-#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 fb98fee3c5..a52dd8a496 100644
--- a/core/src/fxcodec/codec/fx_codec.cpp
+++ b/core/src/fxcodec/codec/fx_codec.cpp
@@ -21,17 +21,14 @@ 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),
+#ifdef PDF_ENABLE_XFA
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 // PDF_ENABLE_XFA
+ m_pFlateModule(new CCodec_FlateModule) {
}
-#endif
CCodec_ScanlineDecoder::ImageDataCache::ImageDataCache(int width,
int height,
@@ -267,6 +264,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),
@@ -284,8 +282,8 @@ CFX_DIBAttribute::~CFX_DIBAttribute() {
for (const auto& pair : m_Exif)
FX_Free(pair.second);
}
+#endif // PDF_ENABLE_XFA
-#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 b5eb4b2692..1276219123 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) {
@@ -242,7 +243,8 @@ static void _JpegLoadAttribute(struct jpeg_decompress_struct* pInfo,
pAttribute->m_wDPIUnit = pInfo->density_unit;
}
}
-#endif
+#endif // PDF_ENABLE_XFA
+
static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf,
FX_DWORD src_size,
int& width,
@@ -629,15 +631,19 @@ void CCodec_JpegModule::Input(void* pContext,
p->m_SrcMgr.next_input_byte = src_buf;
p->m_SrcMgr.bytes_in_buffer = src_size;
}
+
+#ifdef PDF_ENABLE_XFA
int CCodec_JpegModule::ReadHeader(void* pContext,
int* width,
int* height,
-#ifndef PDF_ENABLE_XFA
- int* nComps) {
-#else
int* nComps,
CFX_DIBAttribute* pAttribute) {
-#endif
+#else // PDF_ENABLE_XFA
+int CCodec_JpegModule::ReadHeader(void* pContext,
+ int* width,
+ int* height,
+ int* nComps) {
+#endif // PDF_ENABLE_XFA
FXJPEG_Context* p = (FXJPEG_Context*)pContext;
if (setjmp(p->m_JumpMark) == -1) {
return 1;