Index: ui/gl/gl_image_memory.cc |
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc |
index 20e694ff2fc322d622370749b3d97c5345492f67..0b15f822e5850bc50f4ee1fc5c9398f0d7325eea 100644 |
--- a/ui/gl/gl_image_memory.cc |
+++ b/ui/gl/gl_image_memory.cc |
@@ -45,6 +45,7 @@ bool ValidFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::DXT5: |
case gfx::BufferFormat::ETC1: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::R_16: |
case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_4444: |
@@ -73,6 +74,7 @@ bool IsCompressedFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::ETC1: |
return true; |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::R_16: |
case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::BGR_565: |
case gfx::BufferFormat::RGBA_4444: |
@@ -107,6 +109,8 @@ GLenum TextureFormat(gfx::BufferFormat format) { |
return GL_ETC1_RGB8_OES; |
case gfx::BufferFormat::R_8: |
return GL_RED; |
+ case gfx::BufferFormat::R_16: |
+ return GL_R16_EXT; |
case gfx::BufferFormat::RG_88: |
return GL_RG; |
case gfx::BufferFormat::RGBA_4444: |
@@ -142,6 +146,7 @@ GLenum DataFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::BGRA_8888: |
case gfx::BufferFormat::RGBA_F16: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::R_16: |
case gfx::BufferFormat::RG_88: |
case gfx::BufferFormat::ATC: |
case gfx::BufferFormat::ATCIA: |
@@ -171,6 +176,7 @@ GLenum DataType(gfx::BufferFormat format) { |
case gfx::BufferFormat::BGRX_8888: |
case gfx::BufferFormat::BGRA_8888: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::R_16: |
case gfx::BufferFormat::RG_88: |
return GL_UNSIGNED_BYTE; |
case gfx::BufferFormat::RGBA_F16: |
@@ -206,6 +212,8 @@ GLint DataRowLength(size_t stride, gfx::BufferFormat format) { |
return base::checked_cast<GLint>(stride) / 8; |
case gfx::BufferFormat::R_8: |
return base::checked_cast<GLint>(stride); |
+ case gfx::BufferFormat::R_16: |
+ return base::checked_cast<GLint>(stride); |
case gfx::BufferFormat::ATC: |
case gfx::BufferFormat::ATCIA: |
case gfx::BufferFormat::DXT1: |
@@ -319,6 +327,7 @@ std::unique_ptr<uint8_t[]> GLES2Data(const gfx::Size& size, |
case gfx::BufferFormat::BGRA_8888: |
case gfx::BufferFormat::RGBA_F16: |
case gfx::BufferFormat::R_8: |
+ case gfx::BufferFormat::R_16: |
case gfx::BufferFormat::RG_88: { |
size_t gles2_data_stride = |
RowSizeForBufferFormat(size.width(), format, 0); |