summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-05-10 19:11:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-10 19:11:37 +0000
commit660843f9ea0e75b4efc78d17bbc5661c2d3ea2be (patch)
treefaf01578ed9341eab9c922dbc5fdc8a78c628084 /core/fxcodec/codec
parent80302c77a854e3252bb4c1dc6f09ea3097536092 (diff)
downloadpdfium-660843f9ea0e75b4efc78d17bbc5661c2d3ea2be.tar.xz
Clean up post review comments
Cleaning up some nits that came in after my previous codec CL had gone into the CQ. BUG=pdfium:1080 Change-Id: I3845136d370f73c9c96ef732e95b8cf0c9c79d91 Reviewed-on: https://pdfium-review.googlesource.com/32351 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h2
-rw-r--r--core/fxcodec/codec/fx_codec.cpp17
-rw-r--r--core/fxcodec/codec/fx_codec_progress.cpp8
3 files changed, 6 insertions, 21 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 4eeb59d559..979de6ed25 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -244,13 +244,13 @@ class CCodec_ProgressiveDecoder :
RetainPtr<IFX_SeekableReadStream> m_pFile;
RetainPtr<CFX_DIBitmap> m_pDeviceBitmap;
UnownedPtr<CCodec_ModuleMgr> m_pCodecMgr;
+ std::unique_ptr<CCodec_JpegModule::Context> m_pJpegContext;
#ifdef PDF_ENABLE_XFA_BMP
std::unique_ptr<CCodec_BmpModule::Context> m_pBmpContext;
#endif // PDF_ENABLE_XFA_BMP
#ifdef PDF_ENABLE_XFA_GIF
std::unique_ptr<CCodec_GifModule::Context> m_pGifContext;
#endif // PDF_ENABLE_XFA_GIF
- std::unique_ptr<CCodec_JpegModule::Context> m_pJpegContext;
#ifdef PDF_ENABLE_XFA_PNG
std::unique_ptr<CCodec_PngModule::Context> m_pPngContext;
#endif // PDF_ENABLE_XFA_PNG
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index d81e8f756c..54245a5b99 100644
--- a/core/fxcodec/codec/fx_codec.cpp
+++ b/core/fxcodec/codec/fx_codec.cpp
@@ -1509,22 +1509,7 @@ bool CCodec_BasicModule::A85Encode(const uint8_t* src_buf,
}
#ifdef PDF_ENABLE_XFA
-CFX_DIBAttribute::CFX_DIBAttribute()
- :
-#ifdef PDF_ENABLE_XFA_BMP
- m_nBmpCompressType(0),
-#endif // PDF_ENABLE_BMP
-#ifdef PDF_ENABLE_XFA_GIF
- m_nGifLeft(0),
- m_nGifTop(0),
- m_pGifLocalPalette(nullptr),
- m_nGifLocalPalNum(0),
-#endif // PDF_ENABLE_XFA_GIF
- m_nXDPI(-1),
- m_nYDPI(-1),
- m_fAspectRatio(-1.0f),
- m_wDPIUnit(0) {
-}
+CFX_DIBAttribute::CFX_DIBAttribute() {}
CFX_DIBAttribute::~CFX_DIBAttribute() {
for (const auto& pair : m_Exif)
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index e45dff6682..6b91e864ab 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -1737,6 +1737,8 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType,
memset(m_pSrcBuf, 0, size);
m_SrcSize = size;
switch (imageType) {
+ case FXCODEC_IMAGE_JPG:
+ return JpegDetectImageType(pAttribute, size);
#ifdef PDF_ENABLE_XFA_BMP
case FXCODEC_IMAGE_BMP:
return BmpDetectImageType(pAttribute, size);
@@ -1745,8 +1747,6 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType,
case FXCODEC_IMAGE_GIF:
return GifDetectImageType(pAttribute, size);
#endif // PDF_ENABLE_XFA_GIF
- case FXCODEC_IMAGE_JPG:
- return JpegDetectImageType(pAttribute, size);
#ifdef PDF_ENABLE_XFA_PNG
case FXCODEC_IMAGE_PNG:
return PngDetectImageType(pAttribute, size);
@@ -2444,6 +2444,8 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() {
return FXCODEC_STATUS_ERROR;
switch (m_imagType) {
+ case FXCODEC_IMAGE_JPG:
+ return JpegContinueDecode();
#ifdef PDF_ENABLE_XFA_BMP
case FXCODEC_IMAGE_BMP:
return BmpContinueDecode();
@@ -2452,8 +2454,6 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() {
case FXCODEC_IMAGE_GIF:
return GifContinueDecode();
#endif // PDF_ENABLE_XFA_GIF
- case FXCODEC_IMAGE_JPG:
- return JpegContinueDecode();
#ifdef PDF_ENABLE_XFA_PNG
case FXCODEC_IMAGE_PNG:
return PngContinueDecode();