Index: Source/platform/graphics/DecodingImageGenerator.cpp |
diff --git a/Source/platform/graphics/DecodingImageGenerator.cpp b/Source/platform/graphics/DecodingImageGenerator.cpp |
index 4aa8a6dbffc57813ed87c567d7548c35d2586c47..8c9489c6950a77009c5d9798361b4741b04367b1 100644 |
--- a/Source/platform/graphics/DecodingImageGenerator.cpp |
+++ b/Source/platform/graphics/DecodingImageGenerator.cpp |
@@ -35,6 +35,18 @@ |
namespace blink { |
+bool DecodingImageGenerator::s_decodeToYUVEnabled = false; |
+ |
+void DecodingImageGenerator::setDecodeToYUVEnabled(bool enabled) |
+{ |
+ s_decodeToYUVEnabled = enabled; |
+} |
+ |
+bool DecodingImageGenerator::decodeToYUVEnabled() |
+{ |
+ return s_decodeToYUVEnabled; |
+} |
+ |
DecodingImageGenerator::DecodingImageGenerator(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkImageInfo& info, size_t index) |
: m_frameGenerator(frameGenerator) |
, m_imageInfo(info) |
@@ -85,9 +97,11 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, |
bool DecodingImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], SkYUVColorSpace* colorSpace) |
{ |
- if (!planes || !planes[0]) { |
+ if (!decodeToYUVEnabled()) |
+ return false; |
+ |
+ if (!planes || !planes[0]) |
return m_frameGenerator->getYUVComponentSizes(sizes); |
- } |
TRACE_EVENT0("blink", "DecodingImageGenerator::onGetYUV8Planes"); |
PlatformInstrumentation::willDecodeLazyPixelRef(m_generationId); |