Index: ui/gl/gl_image_memory.cc |
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc |
index 5b43f33cc98709203e83234942d85f5bda806fc7..0c38c9b836d961cf10486f3d015571094a9c8e5b 100644 |
--- a/ui/gl/gl_image_memory.cc |
+++ b/ui/gl/gl_image_memory.cc |
@@ -27,6 +27,7 @@ bool ValidInternalFormat(unsigned internalformat) { |
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: |
case GL_ETC1_RGB8_OES: |
case GL_RED: |
+ case GL_RG: |
case GL_RGB: |
case GL_RGBA: |
case GL_BGRA_EXT: |
@@ -44,6 +45,7 @@ bool ValidFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::DXT5: |
case gfx::BufferFormat::ETC1: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_4444: |
case gfx::BufferFormat::RGBX_8888: |
@@ -70,6 +72,7 @@ bool IsCompressedFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::ETC1: |
return true; |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_4444: |
case gfx::BufferFormat::RGBX_8888: |
@@ -102,6 +105,8 @@ GLenum TextureFormat(gfx::BufferFormat format) { |
return GL_ETC1_RGB8_OES; |
case gfx::BufferFormat::R_8: |
return GL_RED; |
+ case gfx::BufferFormat::RG_88: |
+ return GL_RG; |
case gfx::BufferFormat::RGBA_4444: |
case gfx::BufferFormat::RGBA_8888: |
return GL_RGBA; |
@@ -133,6 +138,7 @@ GLenum DataFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::RGBA_8888: |
case gfx::BufferFormat::BGRA_8888: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::ATC: |
case gfx::BufferFormat::ATCIA: |
case gfx::BufferFormat::DXT1: |
@@ -161,6 +167,7 @@ GLenum DataType(gfx::BufferFormat format) { |
case gfx::BufferFormat::BGRX_8888: |
case gfx::BufferFormat::BGRA_8888: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: |
return GL_UNSIGNED_BYTE; |
case gfx::BufferFormat::ATC: |
case gfx::BufferFormat::ATCIA: |
@@ -180,6 +187,7 @@ GLenum DataType(gfx::BufferFormat format) { |
GLint DataRowLength(size_t stride, gfx::BufferFormat format) { |
switch (format) { |
+ case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_4444: |
return base::checked_cast<GLint>(stride) / 2; |
@@ -301,7 +309,8 @@ std::unique_ptr<uint8_t[]> GLES2Data(const gfx::Size& size, |
case gfx::BufferFormat::RGBA_4444: |
case gfx::BufferFormat::RGBA_8888: |
case gfx::BufferFormat::BGRA_8888: |
- case gfx::BufferFormat::R_8: { |
+ case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::RG_88: { |
size_t gles2_data_stride = |
RowSizeForBufferFormat(size.width(), format, 0); |
if (stride == gles2_data_stride || |