From 81fcde731fe44ef5a11748536a2d6404906c80ff Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 29 Jun 2018 20:45:59 +0000 Subject: Use pdfium::span with CPDF_IccProfile and friends. Change-Id: I88d3e86a1dad75ef9c6bfb3401af6606479031a7 Reviewed-on: https://pdfium-review.googlesource.com/36634 Commit-Queue: Lei Zhang Reviewed-by: Henrique Nakashima --- core/fxcodec/codec/ccodec_iccmodule.h | 5 +++-- core/fxcodec/codec/fx_codec_icc.cpp | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'core/fxcodec') diff --git a/core/fxcodec/codec/ccodec_iccmodule.h b/core/fxcodec/codec/ccodec_iccmodule.h index 419bf17777..64cfb26f9d 100644 --- a/core/fxcodec/codec/ccodec_iccmodule.h +++ b/core/fxcodec/codec/ccodec_iccmodule.h @@ -13,6 +13,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/span.h" #if defined(USE_SYSTEM_LCMS2) #include @@ -45,8 +46,8 @@ class CCodec_IccModule { CCodec_IccModule(); ~CCodec_IccModule(); - std::unique_ptr CreateTransform_sRGB(const uint8_t* pProfileData, - uint32_t dwProfileSize); + std::unique_ptr CreateTransform_sRGB( + pdfium::span span); void Translate(CLcmsCmm* pTransform, const float* pSrcValues, float* pDestValues); diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp index fc82e043b4..7ae93e59b4 100644 --- a/core/fxcodec/codec/fx_codec_icc.cpp +++ b/core/fxcodec/codec/fx_codec_icc.cpp @@ -50,10 +50,8 @@ CCodec_IccModule::CCodec_IccModule() {} CCodec_IccModule::~CCodec_IccModule() {} std::unique_ptr CCodec_IccModule::CreateTransform_sRGB( - const unsigned char* pSrcProfileData, - uint32_t dwSrcProfileSize) { - ScopedCmsProfile srcProfile( - cmsOpenProfileFromMem(pSrcProfileData, dwSrcProfileSize)); + pdfium::span span) { + ScopedCmsProfile srcProfile(cmsOpenProfileFromMem(span.data(), span.size())); if (!srcProfile) return nullptr; -- cgit v1.2.3