| 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) {
|
|
|