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

Unified Diff: Source/platform/graphics/DecodingImageGenerator.cpp

Issue 609923003: Adding blink side flag that allows disabling YUV decoding (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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: Source/platform/graphics/DecodingImageGenerator.cpp
diff --git a/Source/platform/graphics/DecodingImageGenerator.cpp b/Source/platform/graphics/DecodingImageGenerator.cpp
index 4aa8a6dbffc57813ed87c567d7548c35d2586c47..3ab659ab14d85b410dcc761bce11de132d67caf4 100644
--- a/Source/platform/graphics/DecodingImageGenerator.cpp
+++ b/Source/platform/graphics/DecodingImageGenerator.cpp
@@ -35,6 +35,18 @@
namespace blink {
+bool DecodingImageGenerator::s_yuvDecodingEnabled = false;
+
+void DecodingImageGenerator::setYUVDecodingEnabled(bool enabled)
+{
+ s_yuvDecodingEnabled = enabled;
+}
+
+bool DecodingImageGenerator::yuvDecodingEnabled()
+{
+ return s_yuvDecodingEnabled;
+}
+
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 (!yuvDecodingEnabled())
+ return false;
+
+ if (!planes || !planes[0])
return m_frameGenerator->getYUVComponentSizes(sizes);
- }
TRACE_EVENT0("blink", "DecodingImageGenerator::onGetYUV8Planes");
PlatformInstrumentation::willDecodeLazyPixelRef(m_generationId);

Powered by Google App Engine
This is Rietveld 408576698