Index: ui/gl/gl_image_memory.cc |
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc |
index a29a388585fcd41406455446d0156f27deb0075d..cabc6a0972ceabbd5e91b66832903573fccef163 100644 |
--- a/ui/gl/gl_image_memory.cc |
+++ b/ui/gl/gl_image_memory.cc |
@@ -26,7 +26,7 @@ bool ValidInternalFormat(unsigned internalformat) { |
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: |
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: |
case GL_ETC1_RGB8_OES: |
- case GL_RED: |
+ case GL_R8: |
case GL_RGB: |
case GL_RGBA: |
case GL_BGRA_EXT: |
@@ -99,7 +99,9 @@ GLenum TextureFormat(BufferFormat format) { |
case BufferFormat::ETC1: |
return GL_ETC1_RGB8_OES; |
case BufferFormat::R_8: |
- return GL_RED; |
+ return gfx::GLContext::GetCurrent()->GetVersionInfo()->IsES3Capable() |
+ ? GL_R8 |
+ : GL_RED; |
case BufferFormat::RGBA_4444: |
case BufferFormat::RGBA_8888: |
return GL_RGBA; |
@@ -125,10 +127,11 @@ GLenum DataFormat(BufferFormat format) { |
return GL_RGBA; |
case BufferFormat::BGRX_8888: |
return GL_BGRA_EXT; |
+ case BufferFormat::R_8: |
+ return GL_RED; |
case BufferFormat::RGBA_4444: |
case BufferFormat::RGBA_8888: |
case BufferFormat::BGRA_8888: |
- case BufferFormat::R_8: |
case BufferFormat::ATC: |
case BufferFormat::ATCIA: |
case BufferFormat::DXT1: |