[rust png] Remove unused `ProgressiveDecoder::src_pass_number_` field.
After https://pdfium-review.googlesource.com/137272 this field is unused
and can be removed. As a consequence, the `interlace` parameter can
also be removed from `GetRecordPosition` and
`GifInputRecordPositionBuf`.
Bug: 444045690
Change-Id: I66c2076c2ce794b1a1e9673f18006592cee17ab9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/137273
Commit-Queue: Ćukasz Anforowicz <lukasza@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcodec/gif/cfx_gifcontext.cpp b/core/fxcodec/gif/cfx_gifcontext.cpp
index 373bec0..9a0ae91 100644
--- a/core/fxcodec/gif/cfx_gifcontext.cpp
+++ b/core/fxcodec/gif/cfx_gifcontext.cpp
@@ -43,11 +43,10 @@
int32_t width,
int32_t height,
pdfium::span<CFX_GifPalette> pal,
- int32_t trans_index,
- bool interlace) {
+ int32_t trans_index) {
return delegate_->GifInputRecordPositionBuf(
- cur_pos, FX_RECT(left, top, left + width, top + height), pal, trans_index,
- interlace);
+ cur_pos, FX_RECT(left, top, left + width, top + height), pal,
+ trans_index);
}
GifDecoder::Status CFX_GifContext::ReadHeader() {
@@ -180,8 +179,7 @@
bool bRes = GetRecordPosition(
gif_image->data_pos, gif_image->image_info.left,
gif_image->image_info.top, gif_image->image_info.width,
- gif_image->image_info.height, pLocalPalette, -1,
- gif_image->image_info.local_flags.interlace);
+ gif_image->image_info.height, pLocalPalette, -1);
if (!bRes) {
gif_image->row_buffer.clear();
return GifDecoder::Status::kError;
@@ -193,8 +191,7 @@
gif_image->image_info.height, pLocalPalette,
gif_image->image_GCE->gce_flags.transparency
? static_cast<int32_t>(gif_image->image_GCE->trans_index)
- : -1,
- gif_image->image_info.local_flags.interlace);
+ : -1);
if (!bRes) {
gif_image->row_buffer.clear();
return GifDecoder::Status::kError;
diff --git a/core/fxcodec/gif/cfx_gifcontext.h b/core/fxcodec/gif/cfx_gifcontext.h
index 114d56d..abefc05 100644
--- a/core/fxcodec/gif/cfx_gifcontext.h
+++ b/core/fxcodec/gif/cfx_gifcontext.h
@@ -34,8 +34,7 @@
int32_t width,
int32_t height,
pdfium::span<CFX_GifPalette> pal,
- int32_t trans_index,
- bool interlace);
+ int32_t trans_index);
GifDecoder::Status ReadHeader();
GifDecoder::Status GetFrame();
GifDecoder::Status LoadFrame(size_t frame_num);
diff --git a/core/fxcodec/gif/gif_decoder.h b/core/fxcodec/gif/gif_decoder.h
index 3d7a4ca..ef106af 100644
--- a/core/fxcodec/gif/gif_decoder.h
+++ b/core/fxcodec/gif/gif_decoder.h
@@ -35,8 +35,7 @@
virtual bool GifInputRecordPositionBuf(uint32_t rcd_pos,
const FX_RECT& img_rc,
pdfium::span<CFX_GifPalette> pal_ptr,
- int32_t trans_index,
- bool interlace) = 0;
+ int32_t trans_index) = 0;
virtual void GifReadScanline(int32_t row_num,
pdfium::span<uint8_t> row_buf) = 0;
};
diff --git a/core/fxcodec/progressive_decoder.cpp b/core/fxcodec/progressive_decoder.cpp
index 2672a8e..2abc1eb 100644
--- a/core/fxcodec/progressive_decoder.cpp
+++ b/core/fxcodec/progressive_decoder.cpp
@@ -125,8 +125,7 @@
uint32_t rcd_pos,
const FX_RECT& img_rc,
pdfium::span<CFX_GifPalette> pal_span,
- int32_t trans_index,
- bool interlace) {
+ int32_t trans_index) {
offset_ = rcd_pos;
FXCODEC_STATUS error_status = FXCODEC_STATUS::kError;
@@ -148,7 +147,6 @@
}
gif_trans_index_ = trans_index;
gif_frame_rect_ = img_rc;
- src_pass_number_ = interlace ? 4 : 1;
int32_t pal_index = gif_bg_index_;
RetainPtr<CFX_DIBitmap> pDevice = device_bitmap_;
if (trans_index >= static_cast<int>(pal_span.size())) {
@@ -797,7 +795,6 @@
src_height_ = 0;
src_components_count_ = 0;
src_bits_per_component_ = 0;
- src_pass_number_ = 0;
if (imageType != FXCODEC_IMAGE_UNKNOWN &&
DetectImageType(imageType, pAttribute)) {
image_type_ = imageType;
diff --git a/core/fxcodec/progressive_decoder.h b/core/fxcodec/progressive_decoder.h
index 70764bc..01add0b 100644
--- a/core/fxcodec/progressive_decoder.h
+++ b/core/fxcodec/progressive_decoder.h
@@ -98,8 +98,7 @@
bool GifInputRecordPositionBuf(uint32_t rcd_pos,
const FX_RECT& img_rc,
pdfium::span<CFX_GifPalette> pal_span,
- int32_t trans_index,
- bool interlace) override;
+ int32_t trans_index) override;
void GifReadScanline(int32_t row_num, pdfium::span<uint8_t> row_buf) override;
#endif // PDF_ENABLE_XFA_GIF
@@ -211,11 +210,6 @@
TransformMethod trans_method_;
int src_row_ = 0;
FXCodec_Format src_format_ = FXCodec_Invalid;
-
- // TODO(https://crbug.com/444045690): Remove `src_pass_number_` field, because
- // it is never read from (only written to).
- int src_pass_number_ = 0;
-
size_t frame_number_ = 0;
size_t frame_cur_ = 0;
#ifdef PDF_ENABLE_XFA_GIF