CC: Support YUV images in PaintImage and GpuImageDecodeCache

This patch modifies PaintImage to have an interface to indicate
that the underlying image is YUV pixel format and adds a
corresponding DecodeYuv() method.

In GpuImageDecodeCache, this change adds "is YUV" variables/getters to
DecodedImageData, UploadedImageData (has_yuv_planes()), and ImageData,
as well as base:Optional arrays for the SkImages and GL texture IDs for
each Y, U, and V plane in the relevant places.

The YUV decoding path will initially be implemented for in-process
GPU rasterization and later for OOPR (Out of Process Rasterization).
Changes that affect WebP decoding in Blink will be hidden behind a flag called

Finally, because this decides whether to YUV decode based on
the result of PaintImageGenerator::QueryYUVA8, we separately modified
JPEGImageDecoder::CanDecodeToYUV ( and
VideoImageGenerator::QueryYUVA8 (
to return false in order to avoid prematurely going down the YUV decode path.

See for the design document and for a working prototype CL.

Bug: 900672
Change-Id: I14f60d83cc2da2382e3da296fab598597b7e8ec8
Reviewed-by: Miguel Casas <>
Reviewed-by: Khushal <>
Commit-Queue: Madeleine Barowsky <>
Cr-Commit-Position: refs/heads/master@{#625406}
6 files changed