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

Unified Diff: ui/gl/gl_context_glx.cc

Issue 2481973002: gl_context_glx: add workaround to create default context (Closed)
Patch Set: Created 4 years, 1 month 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/config/gpu_driver_bug_workaround_type.h ('k') | ui/gl/gl_switches.h » ('j') | 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..2bdda7ffcbdf52aab33d04e353b522c72e629ab8 100644
--- a/ui/gl/gl_context_glx.cc
+++ b/ui/gl/gl_context_glx.cc
@@ -9,6 +9,7 @@ extern "C" {
}
#include <memory>
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/trace_event/trace_event.h"
@@ -168,9 +169,16 @@ bool GLContextGLX::Initialize(
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.";
« no previous file with comments | « gpu/config/gpu_driver_bug_workaround_type.h ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698