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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « ui/gl/gl_context_android.cc ('k') | ui/gl/gl_version_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index 017e123eb1ff5f566031b9018a6cc2dff715090d..7f6a647fb54c81a52624529cb8d697a7a48aee7d 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -48,6 +48,42 @@ static inline GLenum GetTexInternalFormat(GLenum internal_format,
// g_version_info must be initialized when this function is bound.
DCHECK(gfx::g_version_info);
+ if (gfx::g_version_info->is_es3) {
+ if (format == GL_RED_EXT) {
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ gl_internal_format = GL_R8_EXT;
+ break;
+ case GL_HALF_FLOAT_OES:
+ gl_internal_format = GL_R16F_EXT;
+ break;
+ case GL_FLOAT:
+ gl_internal_format = GL_R32F_EXT;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ return gl_internal_format;
+ } else if (format == GL_RG_EXT) {
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ gl_internal_format = GL_RG8_EXT;
+ break;
+ case GL_HALF_FLOAT_OES:
+ gl_internal_format = GL_RG16F_EXT;
+ break;
+ case GL_FLOAT:
+ gl_internal_format = GL_RG32F_EXT;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ return gl_internal_format;
+ }
+ }
+
if (type == GL_FLOAT && gfx::g_version_info->is_angle &&
gfx::g_version_info->is_es2) {
// It's possible that the texture is using a sized internal format, and
« no previous file with comments | « ui/gl/gl_context_android.cc ('k') | ui/gl/gl_version_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698