From b719bc4a6f219483059f66c33e4a3a7667d75ed5 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 28 Aug 2018 23:15:02 +0000 Subject: Use pdfium::span<> in more image modules Change-Id: Ie344bb37abf7dde158d03cc2897dca3588f1a5e3 Reviewed-on: https://pdfium-review.googlesource.com/41550 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fpdfapi/parser/fpdf_parser_decode.cpp | 14 ++++++-------- core/fpdfapi/parser/fpdf_parser_decode.h | 6 ++---- 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'core/fpdfapi/parser') diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp index 063d21ae5f..ff4f63f0cb 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode.cpp +++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp @@ -258,8 +258,7 @@ uint32_t RunLengthDecode(const uint8_t* src_buf, } std::unique_ptr FPDFAPI_CreateFaxDecoder( - const uint8_t* src_buf, - uint32_t src_size, + pdfium::span src_span, int width, int height, const CPDF_Dictionary* pParams) { @@ -280,13 +279,12 @@ std::unique_ptr FPDFAPI_CreateFaxDecoder( Rows = 0; } return CPDF_ModuleMgr::Get()->GetFaxModule()->CreateDecoder( - src_buf, src_size, width, height, K, EndOfLine, ByteAlign, BlackIs1, - Columns, Rows); + src_span, width, height, K, EndOfLine, ByteAlign, BlackIs1, Columns, + Rows); } std::unique_ptr FPDFAPI_CreateFlateDecoder( - const uint8_t* src_buf, - uint32_t src_size, + pdfium::span src_span, int width, int height, int nComps, @@ -305,8 +303,8 @@ std::unique_ptr FPDFAPI_CreateFlateDecoder( return nullptr; } return CPDF_ModuleMgr::Get()->GetFlateModule()->CreateDecoder( - src_buf, src_size, width, height, nComps, bpc, predictor, Colors, - BitsPerComponent, Columns); + src_span, width, height, nComps, bpc, predictor, Colors, BitsPerComponent, + Columns); } uint32_t FPDFAPI_FlateOrLZWDecode(bool bLZW, diff --git a/core/fpdfapi/parser/fpdf_parser_decode.h b/core/fpdfapi/parser/fpdf_parser_decode.h index 652299992a..bf70997397 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode.h +++ b/core/fpdfapi/parser/fpdf_parser_decode.h @@ -39,15 +39,13 @@ uint32_t RunLengthDecode(const uint8_t* src_buf, uint32_t* dest_size); std::unique_ptr FPDFAPI_CreateFaxDecoder( - const uint8_t* src_buf, - uint32_t src_size, + pdfium::span src_span, int width, int height, const CPDF_Dictionary* pParams); std::unique_ptr FPDFAPI_CreateFlateDecoder( - const uint8_t* src_buf, - uint32_t src_size, + pdfium::span src_span, int width, int height, int nComps, -- cgit v1.2.3