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

Unified Diff: ui/gl/gl_context_glx.cc

Issue 2446103002: gl_context_glx: Do not use core profile on Mesa Optimus (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_glx.cc
diff --git a/ui/gl/gl_context_glx.cc b/ui/gl/gl_context_glx.cc
index 4be08f647d685a15702562c46a9d101c32dc967d..390224093326575c38e29493b404649c5280fa63 100644
--- a/ui/gl/gl_context_glx.cc
+++ b/ui/gl/gl_context_glx.cc
@@ -12,6 +12,7 @@ extern "C" {
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/trace_event/trace_event.h"
+#include "gpu/config/gpu_info_collector.h"
#include "ui/gl/GL/glextchromium.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
@@ -124,20 +125,35 @@ GLXContext CreateHighestVersionContext(Display* display,
std::string client_vendor = glXGetClientString(display, GLX_VENDOR);
bool is_mesa = client_vendor.find("Mesa") != std::string::npos;
+ bool is_mesa_optimus = false;
const ContextCreationInfo* to_try = contexts_to_try;
size_t to_try_length = arraysize(contexts_to_try);
if (is_mesa) {
to_try = mesa_contexts_to_try;
to_try_length = arraysize(mesa_contexts_to_try);
+
+ gpu::GPUInfo gpu_info;
+ gpu::CollectInfoResult result = gpu::CollectBasicGraphicsInfo(&gpu_info);
+
+ is_mesa_optimus = result == gpu::kCollectInfoSucess && gpu_info.optimus;
}
for (size_t i = 0; i < to_try_length; ++i) {
const ContextCreationInfo& info = to_try[i];
+
if (!GLSurfaceGLX::IsCreateContextES2ProfileSupported() &&
info.profileFlag == GLX_CONTEXT_ES2_PROFILE_BIT_EXT) {
continue;
}
+
+ // Core profile on Mesa Optimus causes rendering problems
+ // See https://crbug.com/659030
+ if (is_mesa_optimus &&
+ info.profileFlag == GLX_CONTEXT_CORE_PROFILE_BIT_ARB) {
+ continue;
+ }
+
GLXContext context = CreateContextAttribs(display, config, share,
info.version, info.profileFlag);
if (context != nullptr) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698