From 899b407b1128d0dbba360022a5ced872fabeec3f Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 12 Mar 2018 15:38:02 +0100 Subject: Fix freezes of glx context Add back support for compatibility profile. Change-Id: I746b53c4622614f847540481cdb43da416ba03b1 Reviewed-by: Allan Sandfeld Jensen --- chromium/ui/gl/gl_context_glx.cc | 11 ++++++++--- chromium/ui/gl/gl_switches.cc | 2 ++ chromium/ui/gl/gl_switches.h | 3 +-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/chromium/ui/gl/gl_context_glx.cc b/chromium/ui/gl/gl_context_glx.cc index d66d3119382..280ee88ec7f 100644 --- a/chromium/ui/gl/gl_context_glx.cc +++ b/chromium/ui/gl/gl_context_glx.cc @@ -172,9 +172,14 @@ bool GLContextGLX::Initialize(GLSurface* compatible_surface, if (GLSurfaceGLX::IsCreateContextSupported()) { DVLOG(1) << "GLX_ARB_create_context supported."; - context_ = CreateHighestVersionContext( - display_, static_cast(compatible_surface->GetConfig()), - share_handle); + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kCreateDefaultGLContext)) { + context_ = CreateContextAttribs(display_, static_cast(compatible_surface->GetConfig()), + share_handle, GLVersion(0, 0), 0); + } else { + context_ = CreateHighestVersionContext( + display_, static_cast(compatible_surface->GetConfig()), + share_handle); + } if (!context_) { LOG(ERROR) << "Failed to create GL context with " << "glXCreateContextAttribsARB."; diff --git a/chromium/ui/gl/gl_switches.cc b/chromium/ui/gl/gl_switches.cc index 5ea1e341f3d..2b28f0122b2 100644 --- a/chromium/ui/gl/gl_switches.cc +++ b/chromium/ui/gl/gl_switches.cc @@ -132,6 +132,8 @@ const char* const kGLSwitchesCopiedFromGpuProcessHost[] = { const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches = arraysize(kGLSwitchesCopiedFromGpuProcessHost); +const char kCreateDefaultGLContext[] = "create-default-gl-context"; + } // namespace switches namespace features { diff --git a/chromium/ui/gl/gl_switches.h b/chromium/ui/gl/gl_switches.h index 404dee8f712..da312131114 100644 --- a/chromium/ui/gl/gl_switches.h +++ b/chromium/ui/gl/gl_switches.h @@ -30,7 +30,6 @@ GL_EXPORT extern const char kANGLEImplementationD3D11Name[]; GL_EXPORT extern const char kANGLEImplementationOpenGLName[]; GL_EXPORT extern const char kANGLEImplementationOpenGLESName[]; GL_EXPORT extern const char kANGLEImplementationNullName[]; - } // namespace gl namespace switches { @@ -59,7 +58,7 @@ GL_EXPORT extern const char kOverrideUseSoftwareGLForTests[]; GL_EXPORT extern const char* const kGLSwitchesCopiedFromGpuProcessHost[]; GL_EXPORT extern const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches; - +GL_EXPORT extern const char kCreateDefaultGLContext[]; } // namespace switches namespace features { -- cgit v1.2.1