summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_iccprofile.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-06-29 20:45:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-29 20:45:59 +0000
commit81fcde731fe44ef5a11748536a2d6404906c80ff (patch)
tree641251da3da640cecb9210017293f5050fa563dd /core/fpdfapi/page/cpdf_iccprofile.cpp
parent238947ce91a07fc4fbb17de0a140349446ff4898 (diff)
downloadpdfium-81fcde731fe44ef5a11748536a2d6404906c80ff.tar.xz
Use pdfium::span with CPDF_IccProfile and friends.
Change-Id: I88d3e86a1dad75ef9c6bfb3401af6606479031a7 Reviewed-on: https://pdfium-review.googlesource.com/36634 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_iccprofile.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_iccprofile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_iccprofile.cpp b/core/fpdfapi/page/cpdf_iccprofile.cpp
index ef1b9ef434..94270b110b 100644
--- a/core/fpdfapi/page/cpdf_iccprofile.cpp
+++ b/core/fpdfapi/page/cpdf_iccprofile.cpp
@@ -12,23 +12,23 @@
namespace {
-bool DetectSRGB(const uint8_t* pData, uint32_t dwSize) {
- return dwSize == 3144 && memcmp(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0;
+bool DetectSRGB(pdfium::span<const uint8_t> span) {
+ return span.size() == 3144 &&
+ memcmp(span.data() + 0x190, "sRGB IEC61966-2.1", 17) == 0;
}
} // namespace
CPDF_IccProfile::CPDF_IccProfile(const CPDF_Stream* pStream,
- const uint8_t* pData,
- uint32_t dwSize)
- : m_bsRGB(DetectSRGB(pData, dwSize)), m_pStream(pStream) {
+ pdfium::span<const uint8_t> span)
+ : m_bsRGB(DetectSRGB(span)), m_pStream(pStream) {
if (m_bsRGB) {
m_nSrcComponents = 3;
return;
}
auto* pIccModule = CPDF_ModuleMgr::Get()->GetIccModule();
- m_Transform = pIccModule->CreateTransform_sRGB(pData, dwSize);
+ m_Transform = pIccModule->CreateTransform_sRGB(span);
if (m_Transform)
m_nSrcComponents = m_Transform->components();
}