diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-23 23:52:53 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-23 23:52:53 +0000 |
commit | 367ed462b51799c008795b19e886ccbed221b9be (patch) | |
tree | 3c94f25900ec5617954dbfd3e615e6a4751ddfcd /core/fpdfapi/page | |
parent | c1dde5d9b3da2af6e6f81df09ed41ab9c34bbde4 (diff) | |
download | pdfium-367ed462b51799c008795b19e886ccbed221b9be.tar.xz |
Use pdfium::span<> in CPDF_Stream::SetData().
Conversion to span makes this more elegant in a number of places,
owing to std::vector directly converting to span, and the bytestring's
ToRawSpan().
Disambiguate single-argument forms to allow passing {} as
an argument.
Change-Id: Ibd5eaadca8d8cbbd589338f375c7ee8439fd3eb2
Reviewed-on: https://pdfium-review.googlesource.com/41272
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r-- | core/fpdfapi/page/cpdf_image.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp index a8b593682b..a1be407dfe 100644 --- a/core/fpdfapi/page/cpdf_image.cpp +++ b/core/fpdfapi/page/cpdf_image.cpp @@ -155,7 +155,7 @@ void CPDF_Image::SetJpegImageInline( if (!pDict) return; - m_pStream->InitStream(&(data[0]), size, std::move(pDict)); + m_pStream->InitStream(data, std::move(pDict)); } void CPDF_Image::SetImage(const RetainPtr<CFX_DIBitmap>& pBitmap) { @@ -316,7 +316,7 @@ void CPDF_Image::SetImage(const RetainPtr<CFX_DIBitmap>& pBitmap) { if (!m_pStream) m_pStream = pdfium::MakeUnique<CPDF_Stream>(); - m_pStream->InitStream(dest_buf, dest_size, std::move(pDict)); + m_pStream->InitStream({dest_buf, dest_size}, std::move(pDict)); m_bIsMask = pBitmap->IsAlphaMask(); m_Width = BitmapWidth; m_Height = BitmapHeight; |