Index: ui/ozone/gl/gl_image_ozone_native_pixmap.cc |
diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc |
index 4df05e7348cc099538fc1943941d0fc9d82527f5..238ff70b121c8447fe52ccc0e2255733551e3bee 100644 |
--- a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc |
+++ b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc |
@@ -14,6 +14,7 @@ |
(static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24)) |
#define DRM_FORMAT_R8 FOURCC('R', '8', ' ', ' ') |
+#define DRM_FORMAT_GR88 FOURCC('G', 'R', '8', '8') |
#define DRM_FORMAT_RGB565 FOURCC('R', 'G', '1', '6') |
#define DRM_FORMAT_ARGB8888 FOURCC('A', 'R', '2', '4') |
#define DRM_FORMAT_ABGR8888 FOURCC('A', 'B', '2', '4') |
@@ -41,6 +42,8 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) { |
return format == gfx::BufferFormat::BGRA_8888; |
case GL_RED_EXT: |
return format == gfx::BufferFormat::R_8; |
+ case GL_RG_EXT: |
+ return format == gfx::BufferFormat::RG_88; |
default: |
return false; |
} |
@@ -49,6 +52,7 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) { |
bool ValidFormat(gfx::BufferFormat format) { |
switch (format) { |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_8888: |
case gfx::BufferFormat::RGBX_8888: |
@@ -75,6 +79,8 @@ EGLint FourCC(gfx::BufferFormat format) { |
switch (format) { |
case gfx::BufferFormat::R_8: |
return DRM_FORMAT_R8; |
+ case gfx::BufferFormat::RG_88: |
+ return DRM_FORMAT_GR88; |
case gfx::BufferFormat::BGR_565: |
return DRM_FORMAT_RGB565; |
case gfx::BufferFormat::RGBA_8888: |
@@ -110,6 +116,7 @@ bool IsFormatCrCb(gfx::BufferFormat format) { |
case gfx::BufferFormat::YVU_420: |
return true; |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_8888: |
case gfx::BufferFormat::RGBX_8888: |
@@ -287,6 +294,8 @@ unsigned GLImageOzoneNativePixmap::GetInternalFormatForTesting( |
switch (format) { |
case gfx::BufferFormat::R_8: |
return GL_RED_EXT; |
+ case gfx::BufferFormat::RG_88: |
+ return GL_RG_EXT; |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBX_8888: |
case gfx::BufferFormat::BGRX_8888: |