summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_progressivedecoder.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-05-09 21:06:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-09 21:06:22 +0000
commit607f3cd63a314cd3a6c219b19cce31805b66cd6d (patch)
tree74c9bff427b4c8f4697ee28b17bbebe2be411cb2 /core/fxcodec/codec/ccodec_progressivedecoder.h
parentd5d48457dabbe71e7f6b0baf2eaea6aa0dc86736 (diff)
downloadpdfium-607f3cd63a314cd3a6c219b19cce31805b66cd6d.tar.xz
Do not build GIF when codec is disabled
Currently all of the GIF related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the GIF codec code if support for GIF is turned off. This also catches a few missed cases from previous CLs. BUG=pdfium:1080 Change-Id: Ie7fe2d894d2ae2f8f36ae05e0ff256f2ce6ef8d4 Reviewed-on: https://pdfium-review.googlesource.com/32330 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h')
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 476a7c1b4a..07716a80ae 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -12,7 +12,6 @@
#include <vector>
#include "core/fxcodec/codec/ccodec_bmpmodule.h"
-#include "core/fxcodec/codec/ccodec_gifmodule.h"
#include "core/fxcodec/codec/ccodec_jpegmodule.h"
#include "core/fxcodec/fx_codec_def.h"
#include "core/fxcrt/fx_system.h"
@@ -21,6 +20,10 @@
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_dib.h"
+#ifdef PDF_ENABLE_XFA_GIF
+#include "core/fxcodec/codec/ccodec_gifmodule.h"
+#endif // PDF_ENABLE_XFA_gif
+
#ifdef PDF_ENABLE_XFA_PNG
#include "core/fxcodec/codec/ccodec_pngmodule.h"
#endif // PDF_ENABLE_XFA_PNG
@@ -36,7 +39,9 @@ class IFX_SeekableReadStream;
class CCodec_Dummy {}; // Placeholder to work around C++ syntax issues
class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
+#ifdef PDF_ENABLE_XFA_GIF
public CCodec_GifModule::Delegate,
+#endif // PDF_ENABLE_XFA_GIF
#ifdef PDF_ENABLE_XFA_PNG
public CCodec_PngModule::Delegate,
#endif // PDF_ENABLE_XFA_PNG
@@ -146,6 +151,7 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
void PngFillScanlineBufCompleted(int pass, int line) override;
#endif // PDF_ENABLE_XFA_PNG
+#ifdef PDF_ENABLE_XFA_GIF
// CCodec_GifModule::Delegate
void GifRecordCurrentPosition(uint32_t& cur_pos) override;
bool GifInputRecordPositionBuf(uint32_t rcd_pos,
@@ -158,6 +164,7 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
int32_t disposal_method,
bool interlace) override;
void GifReadScanline(int32_t row_num, uint8_t* row_buf) override;
+#endif // PDF_ENABLE_XFA_GIF
// CCodec_BmpModule::Delegate
bool BmpInputImagePositionBuf(uint32_t rcd_pos) override;
@@ -171,6 +178,7 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
FXCODEC_STATUS BmpStartDecode(const RetainPtr<CFX_DIBitmap>& pDIBitmap);
FXCODEC_STATUS BmpContinueDecode();
+#ifdef PDF_ENABLE_XFA_GIF
bool GifReadMoreData(CCodec_GifModule* pGifModule,
FXCODEC_STATUS& err_status);
bool GifDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size);
@@ -179,6 +187,7 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
void GifDoubleLineResampleVert(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
double scale_y,
int dest_row);
+#endif // PDF_ENABLE_XFA_GIF
bool JpegReadMoreData(CCodec_JpegModule* pJpegModule,
FXCODEC_STATUS& err_status);
@@ -229,7 +238,9 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
#ifdef PDF_ENABLE_XFA_PNG
std::unique_ptr<CCodec_PngModule::Context> m_pPngContext;
#endif // PDF_ENABLE_XFA_PNG
+#ifdef PDF_ENABLE_XFA_GIF
std::unique_ptr<CCodec_GifModule::Context> m_pGifContext;
+#endif // PDF_ENABLE_XFA_GIF
std::unique_ptr<CCodec_BmpModule::Context> m_pBmpContext;
#ifdef PDF_ENABLE_XFA_TIFF
std::unique_ptr<CCodec_TiffModule::Context> m_pTiffContext;
@@ -260,14 +271,16 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
int m_SrcPassNumber;
size_t m_FrameNumber;
size_t m_FrameCur;
+#ifdef PDF_ENABLE_XFA_GIF
int m_GifBgIndex;
CFX_GifPalette* m_pGifPalette;
int32_t m_GifPltNumber;
int m_GifTransIndex;
FX_RECT m_GifFrameRect;
+ bool m_InvalidateGifBuffer;
+#endif // PDF_ENABLE_XFA_GIF
bool m_BmpIsTopBottom;
FXCODEC_STATUS m_status;
- bool m_InvalidateGifBuffer;
};
#endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_