Chromium Code Reviews| 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 9dbb29faac40b2a9d9507ed61c7ef00c610fdeb9..a56638808c7fbd375cd3794ad36a5a198ab93301 100644 |
| --- a/ui/gl/gl_gl_api_implementation.cc |
| +++ b/ui/gl/gl_gl_api_implementation.cc |
| @@ -36,10 +36,15 @@ static GLVersionInfo* g_version_info = NULL; |
| namespace { |
| static inline GLenum GetInternalFormat(GLenum internal_format) { |
| - if (GetGLImplementation() != kGLImplementationEGLGLES2) { |
| + if (!g_version_info->is_es) { |
| if (internal_format == GL_BGRA_EXT || internal_format == GL_BGRA8_EXT) |
| return GL_RGBA8; |
| } |
| + if (g_version_info->is_es && g_version_info->is_mesa) { |
| + // Mesa bug workaround: Mipmapping does not work when using GL_BGRA_EXT |
| + if (internal_format == GL_BGRA_EXT) |
| + return GL_RGBA; |
|
piman
2016/07/21 16:31:37
This isn't valid on ES2. Did you mean to restrict
Justin Novosad
2016/07/21 17:33:56
Right, because it would violate the internal == ex
|
| + } |
| return internal_format; |
| } |
| @@ -47,10 +52,10 @@ static inline GLenum GetInternalFormat(GLenum internal_format) { |
| static inline GLenum GetTexInternalFormat(GLenum internal_format, |
| GLenum format, |
| GLenum type) { |
| + DCHECK(g_version_info); |
| GLenum gl_internal_format = GetInternalFormat(internal_format); |
| // g_version_info must be initialized when this function is bound. |
| - DCHECK(g_version_info); |
| if (g_version_info->is_es3) { |
| if (internal_format == GL_RED_EXT) { |
| // GL_EXT_texture_rg case in ES2. |