summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-25 18:37:31 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-25 18:37:31 +0000
commit2929d135d076fb6927a02ff94935d5efc45e7257 (patch)
treec98eb3e42ffee4159eee63c512202f5b985b0b87
parent00721f053a1f0b47370d86a60356c4560e92ddf2 (diff)
downloadpdfium-2929d135d076fb6927a02ff94935d5efc45e7257.tar.xz
Remove unused PNGEncode() code.
BUG=pdfium:41 Change-Id: I98070a5a6c88a0769f2b571eae4fe62092f7dfcd Reviewed-on: https://pdfium-review.googlesource.com/31232 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--core/fpdfapi/parser/fpdf_parser_decode.cpp9
-rw-r--r--core/fpdfapi/parser/fpdf_parser_decode.h8
-rw-r--r--core/fxcodec/codec/ccodec_flatemodule.h5
-rw-r--r--core/fxcodec/codec/fx_codec_flate.cpp38
4 files changed, 0 insertions, 60 deletions
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp
index edfbaf4331..e734183b2b 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp
@@ -559,15 +559,6 @@ bool FlateEncode(const uint8_t* src_buf,
dest_size);
}
-bool PngEncode(const uint8_t* src_buf,
- uint32_t src_size,
- uint8_t** dest_buf,
- uint32_t* dest_size) {
- CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
- return pEncoders->GetFlateModule()->PngEncode(src_buf, src_size, dest_buf,
- dest_size);
-}
-
uint32_t FlateDecode(const uint8_t* src_buf,
uint32_t src_size,
uint8_t** dest_buf,
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.h b/core/fpdfapi/parser/fpdf_parser_decode.h
index d60e551e80..825d431019 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.h
+++ b/core/fpdfapi/parser/fpdf_parser_decode.h
@@ -28,14 +28,6 @@ bool FlateEncode(const uint8_t* src_buf,
uint8_t** dest_buf,
uint32_t* dest_size);
-// This used to have more parameters like the predictor and bpc, but there was
-// only one caller, so the interface has been simplified, the values are hard
-// coded, and dead code has been removed.
-bool PngEncode(const uint8_t* src_buf,
- uint32_t src_size,
- uint8_t** dest_buf,
- uint32_t* dest_size);
-
uint32_t FlateDecode(const uint8_t* src_buf,
uint32_t src_size,
uint8_t** dest_buf,
diff --git a/core/fxcodec/codec/ccodec_flatemodule.h b/core/fxcodec/codec/ccodec_flatemodule.h
index ae34103f3b..c84be7cc87 100644
--- a/core/fxcodec/codec/ccodec_flatemodule.h
+++ b/core/fxcodec/codec/ccodec_flatemodule.h
@@ -41,11 +41,6 @@ class CCodec_FlateModule {
uint32_t src_size,
uint8_t** dest_buf,
uint32_t* dest_size);
-
- bool PngEncode(const uint8_t* src_buf,
- uint32_t src_size,
- uint8_t** dest_buf,
- uint32_t* dest_size);
};
#endif // CORE_FXCODEC_CODEC_CCODEC_FLATEMODULE_H_
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index 8cef6c7125..7b446f6445 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -265,32 +265,6 @@ uint8_t PathPredictor(int a, int b, int c) {
return (uint8_t)c;
}
-void PNG_PredictorEncode(uint8_t** data_buf, uint32_t* data_size) {
- const int row_size = 7;
- const int row_count = (*data_size + row_size - 1) / row_size;
- const int last_row_size = *data_size % row_size;
- uint8_t* dest_buf = FX_Alloc2D(uint8_t, row_size + 1, row_count);
- int byte_cnt = 0;
- uint8_t* pSrcData = *data_buf;
- uint8_t* pDestData = dest_buf;
- for (int row = 0; row < row_count; row++) {
- for (int byte = 0; byte < row_size && byte_cnt < (int)*data_size; byte++) {
- pDestData[0] = 2;
- uint8_t up = 0;
- if (row)
- up = pSrcData[byte - row_size];
- pDestData[byte + 1] = pSrcData[byte] - up;
- ++byte_cnt;
- }
- pDestData += (row_size + 1);
- pSrcData += row_size;
- }
- FX_Free(*data_buf);
- *data_buf = dest_buf;
- *data_size = (row_size + 1) * row_count -
- (last_row_size > 0 ? (row_size - last_row_size) : 0);
-}
-
void PNG_PredictLine(uint8_t* pDestData,
const uint8_t* pSrcData,
const uint8_t* pLastLine,
@@ -827,15 +801,3 @@ bool CCodec_FlateModule::Encode(const uint8_t* src_buf,
*dest_size = (uint32_t)temp_size;
return true;
}
-
-bool CCodec_FlateModule::PngEncode(const uint8_t* src_buf,
- uint32_t src_size,
- uint8_t** dest_buf,
- uint32_t* dest_size) {
- uint8_t* pSrcBuf = FX_Alloc(uint8_t, src_size);
- memcpy(pSrcBuf, src_buf, src_size);
- PNG_PredictorEncode(&pSrcBuf, &src_size);
- bool ret = Encode(pSrcBuf, src_size, dest_buf, dest_size);
- FX_Free(pSrcBuf);
- return ret;
-}