Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: ui/gl/gl_image_memory.cc

Issue 1708263002: gpu: Expose internal format R8 instead of RED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's comments. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/gl/gl_image_io_surface.mm ('K') | « ui/gl/gl_image_io_surface.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
Zhenyao Mo 2016/02/22 22:53:08 Please also keep GL_RED
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;
Zhenyao Mo 2016/02/22 22:53:08 Why not let TextureFormat() deal with it here?
Daniele Castagna 2016/02/22 23:16:33 TextureFormat returns GL_R8 for ES3. IIUC DataForm
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:
« ui/gl/gl_image_io_surface.mm ('K') | « ui/gl/gl_image_io_surface.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698