Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 2454123002: Refactor image decoders to use 'colorSpace' instead of 'colorProfile' (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 4f3aae427d7f85e6803e6284c13a6fe43583f498..54fc596348d8a1010d1d040ee088c38a8fc0c3f5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -247,7 +247,7 @@ bool WEBPImageDecoder::updateDemuxer() {
m_formatFlags &= ~ICCP_FLAG;
}
- if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
+ if ((m_formatFlags & ICCP_FLAG) && !ignoresColorSpace())
readColorProfile();
}
@@ -267,8 +267,8 @@ bool WEBPImageDecoder::initFrameBuffer(size_t frameIndex) {
const size_t requiredPreviousFrameIndex = buffer.requiredPreviousFrameIndex();
if (requiredPreviousFrameIndex == kNotFound) {
// This frame doesn't rely on any previous data.
- if (!buffer.setSizeAndColorProfile(size().width(), size().height(),
- colorProfile()))
+ if (!buffer.setSizeAndColorSpace(size().width(), size().height(),
+ colorSpace()))
return setFailed();
m_frameBackgroundHasAlpha =
!buffer.originalFrameRect().contains(IntRect(IntPoint(), size()));
@@ -342,8 +342,7 @@ void WEBPImageDecoder::readColorProfile() {
reinterpret_cast<const char*>(chunkIterator.chunk.bytes);
size_t profileSize = chunkIterator.chunk.size;
- setColorSpaceAndComputeTransform(profileData, profileSize,
- false /* useSRGB */);
+ setColorSpaceAndComputeTransform(profileData, profileSize);
WebPDemuxReleaseChunkIterator(&chunkIterator);
}
@@ -522,8 +521,8 @@ bool WEBPImageDecoder::decodeSingleFrame(const uint8_t* dataBytes,
ASSERT(buffer.getStatus() != ImageFrame::FrameComplete);
if (buffer.getStatus() == ImageFrame::FrameEmpty) {
- if (!buffer.setSizeAndColorProfile(size().width(), size().height(),
- colorProfile()))
+ if (!buffer.setSizeAndColorSpace(size().width(), size().height(),
+ colorSpace()))
return setFailed();
buffer.setStatus(ImageFrame::FramePartial);
// The buffer is transparent outside the decoded area while the image is

Powered by Google App Engine
This is Rietveld 408576698