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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 2164723003: Fix gpu mipmap support on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indentation Created 4 years, 5 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
« no previous file with comments | « gpu/gpu.gyp ('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 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.
« no previous file with comments | « gpu/gpu.gyp ('k') | ui/gl/gl_version_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698