summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-03-12 15:38:02 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-23 13:31:33 +0200
commitd8959ce9d76544337c2c284302613daabc8f6028 (patch)
tree9b6627a1621276b28a5bd35ddbfdafbb4cbe3889
parentc926e41f3a42720c0de20bab43b8b585c218273b (diff)
Fix freezes of glx context
Add back support for compatibility profile. Change-Id: I746b53c4622614f847540481cdb43da416ba03b1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/ui/gl/gl_context_glx.cc11
-rw-r--r--chromium/ui/gl/gl_switches.cc2
-rw-r--r--chromium/ui/gl/gl_switches.h2
3 files changed, 11 insertions, 4 deletions
diff --git a/chromium/ui/gl/gl_context_glx.cc b/chromium/ui/gl/gl_context_glx.cc
index abbe288ea29..541d7ad8c08 100644
--- a/chromium/ui/gl/gl_context_glx.cc
+++ b/chromium/ui/gl/gl_context_glx.cc
@@ -170,9 +170,14 @@ bool GLContextGLX::Initialize(GLSurface* compatible_surface,
if (GLSurfaceGLX::IsCreateContextSupported()) {
DVLOG(1) << "GLX_ARB_create_context supported.";
- context_ = CreateHighestVersionContext(
- display_, static_cast<GLXFBConfig>(compatible_surface->GetConfig()),
- share_handle);
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kCreateDefaultGLContext)) {
+ context_ = CreateContextAttribs(display_, static_cast<GLXFBConfig>(compatible_surface->GetConfig()),
+ share_handle, GLVersion(0, 0), 0);
+ } else {
+ context_ = CreateHighestVersionContext(
+ display_, static_cast<GLXFBConfig>(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 63573c0df09..31f9003cbe7 100644
--- a/chromium/ui/gl/gl_switches.cc
+++ b/chromium/ui/gl/gl_switches.cc
@@ -141,6 +141,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 331887e4540..a3d0f7b69b1 100644
--- a/chromium/ui/gl/gl_switches.h
+++ b/chromium/ui/gl/gl_switches.h
@@ -64,7 +64,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 {