Add Blink feature flag for decoding of lossy WebP to YUV

We can significantly speed up WebP rendering and reduce memory footprint
per image by decoding and storing lossy WebP images into their native
YUV format instead of unnecessarily converting to RGB.

This flag will be used to safely hide changes to the image decoding
paths until the feature is completely landed.

See bit.ly/webp-decoding-into-yuv for the design document and
crrev.com/c/1338461 for a working prototype CL in the GPU rasterization case.

Bug: 900264
Change-Id: I611d17199cae4724332d73a5606f20d4eedf9010
Reviewed-on: https://chromium-review.googlesource.com/c/1366858
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614761}
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
index 07ddae7..48096f1d 100644
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -146,5 +146,10 @@
 const char kMixedContentAutoupgradeModeOptionallyBlockable[] =
     "optionally-blockable";
 
+// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
+// in the image decode cache. See crbug.com/900264 for details on the feature.
+const base::Feature kDecodeLossyWebPImagesToYUV{
+    "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
+
 }  // namespace features
 }  // namespace blink
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h
index 8e586469..05f70bf 100644
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -51,6 +51,8 @@
 BLINK_COMMON_EXPORT extern const char
     kMixedContentAutoupgradeModeOptionallyBlockable[];
 
+BLINK_COMMON_EXPORT extern const base::Feature kDecodeLossyWebPImagesToYUV;
+
 }  // namespace features
 }  // namespace blink