| Index: ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
|
| diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
|
| index 78514efaf6d53440fdd5c284f47dad084cc0da0e..fea23aa039d3b8b8019eb1fba37bda0685c0983f 100644
|
| --- a/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
|
| +++ b/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
|
| @@ -21,6 +21,11 @@ namespace {
|
| const uint8_t kRed[] = {0xF0, 0x0, 0x0, 0xFF};
|
| const uint8_t kGreen[] = {0x0, 0xFF, 0x0, 0xFF};
|
|
|
| +// These values are picked so that RGB -> YVU on the CPU converted
|
| +// back to RGB on the GPU produces the original RGB values without
|
| +// any error.
|
| +const uint8_t kYvuColor[] = {0x10, 0x20, 0, 0xFF};
|
| +
|
| template <gfx::BufferUsage usage, gfx::BufferFormat format>
|
| class GLImageOzoneNativePixmapTestDelegate {
|
| public:
|
| @@ -62,7 +67,12 @@ class GLImageOzoneNativePixmapTestDelegate {
|
| unsigned GetTextureTarget() const { return GL_TEXTURE_EXTERNAL_OES; }
|
|
|
| const uint8_t* GetImageColor() {
|
| - return format == gfx::BufferFormat::R_8 ? kRed : kGreen;
|
| + if (format == gfx::BufferFormat::R_8) {
|
| + return kRed;
|
| + } else if (format == gfx::BufferFormat::YVU_420) {
|
| + return kYvuColor;
|
| + }
|
| + return kGreen;
|
| }
|
|
|
| private:
|
| @@ -88,7 +98,10 @@ using GLImageBindTestTypes =
|
| gfx::BufferFormat::BGRA_8888>,
|
| GLImageOzoneNativePixmapTestDelegate<
|
| gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
|
| - gfx::BufferFormat::R_8>>;
|
| + gfx::BufferFormat::R_8>,
|
| + GLImageOzoneNativePixmapTestDelegate<
|
| + gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
|
| + gfx::BufferFormat::YVU_420>>;
|
|
|
| // These tests are disabled since the trybots are running with Ozone X11
|
| // implementation that doesn't support creating ClientNativePixmap.
|
|
|