Index: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp |
index 1411c494248a4a21170f245dc5e8aaa5899035ae..45597121c20fcd02d42f9007b7f04a334b9f1f54 100644 |
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp |
@@ -26,6 +26,7 @@ |
#include "platform/graphics/DeferredImageDecoder.h" |
#include "platform/RuntimeEnabledFeatures.h" |
+#include "platform/graphics/ColorSpaceFilter.h" |
#include "platform/graphics/DecodingImageGenerator.h" |
#include "platform/graphics/FrameData.h" |
#include "platform/graphics/ImageDecodingStore.h" |
@@ -57,8 +58,8 @@ DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecode |
, m_lastDataSize(0) |
, m_actualDecoder(std::move(actualDecoder)) |
, m_repetitionCount(cAnimationNone) |
- , m_hasColorProfile(false) |
, m_canYUVDecode(false) |
+ , m_hasColorProfile(false) |
{ |
} |
@@ -134,6 +135,14 @@ bool DeferredImageDecoder::hasColorProfile() const |
return m_actualDecoder ? m_actualDecoder->hasColorProfile() : m_hasColorProfile; |
} |
+PassRefPtr<ColorSpaceProfile> DeferredImageDecoder::colorProfile() const |
+{ |
+ if (m_actualDecoder) |
+ return m_actualDecoder->colorProfile(); |
+ |
+ return m_colorProfile; |
+} |
+ |
IntSize DeferredImageDecoder::size() const |
{ |
return m_actualDecoder ? m_actualDecoder->size() : m_size; |
@@ -225,6 +234,7 @@ void DeferredImageDecoder::activateLazyDecoding() |
// JPEG images support YUV decoding: other decoders do not, WEBP could in future. |
m_canYUVDecode = RuntimeEnabledFeatures::decodeToYUVEnabled() && (m_filenameExtension == "jpg"); |
m_hasColorProfile = m_actualDecoder->hasColorProfile(); |
+ m_colorProfile = m_hasColorProfile ? m_actualDecoder->colorProfile() : nullptr; |
const bool isSingleFrame = m_actualDecoder->repetitionCount() == cAnimationNone || (m_allDataReceived && m_actualDecoder->frameCount() == 1u); |
m_frameGenerator = ImageFrameGenerator::create(SkISize::Make(m_actualDecoder->decodedSize().width(), m_actualDecoder->decodedSize().height()), m_data, m_allDataReceived, !isSingleFrame); |