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 e5a1c88f4df1115947612dde313db1ccba1d5f38..bfcbb53dd43a2ba990045c0cc563e9c8073a5eea 100644 |
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp |
@@ -26,6 +26,7 @@ |
#include "config.h" |
#include "platform/graphics/DeferredImageDecoder.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/graphics/DecodingImageGenerator.h" |
#include "platform/graphics/FrameData.h" |
#include "platform/graphics/ImageDecodingStore.h" |
@@ -58,6 +59,7 @@ DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecode |
, m_actualDecoder(actualDecoder) |
, m_repetitionCount(cAnimationNone) |
, m_hasColorProfile(false) |
+ , m_canYUVDecode(false) |
{ |
} |
@@ -214,9 +216,13 @@ void DeferredImageDecoder::activateLazyDecoding() |
{ |
if (m_frameGenerator) |
return; |
+ |
m_size = m_actualDecoder->size(); |
m_filenameExtension = m_actualDecoder->filenameExtension(); |
+ // JPEG images support YUV decoding: other decoders do not, WEBP could in future. |
+ m_canYUVDecode = !RuntimeEnabledFeatures::decodeToYUVEnabled() || (m_filenameExtension == "jpg"); |
Noel Gordon
2015/12/07 13:03:52
Clearly, need to fix that.
|
m_hasColorProfile = m_actualDecoder->hasColorProfile(); |
+ |
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); |
} |
@@ -276,6 +282,7 @@ PassRefPtr<SkImage> DeferredImageDecoder::createFrameImageAtIndex(size_t index, |
return nullptr; |
generator->setGenerationId(image->uniqueID()); |
+ generator->setCanYUVDecode(m_canYUVDecode); |
return image.release(); |
} |