Index: ui/gl/init/gl_initializer_x11.cc |
diff --git a/ui/gl/init/gl_initializer_x11.cc b/ui/gl/init/gl_initializer_x11.cc |
index 27fca0394649859884021fb3e2958f1ce07cb454..b8697bdb10bdd50061dbb5399e30d41bb68d4d03 100644 |
--- a/ui/gl/init/gl_initializer_x11.cc |
+++ b/ui/gl/init/gl_initializer_x11.cc |
@@ -9,6 +9,7 @@ |
#include "base/path_service.h" |
#include "base/threading/thread_restrictions.h" |
#include "build/build_config.h" |
+#include "ui/gfx/switches.h" |
#include "ui/gfx/x/x11_types.h" |
#include "ui/gl/gl_bindings.h" |
#include "ui/gl/gl_egl_api_implementation.h" |
@@ -124,6 +125,11 @@ bool InitializeStaticEGLInternal() { |
} // namespace |
bool InitializeGLOneOffPlatform() { |
+ const base::CommandLine* command_line = |
+ base::CommandLine::ForCurrentProcess(); |
+ if (command_line->HasSwitch(switches::kHeadless)) |
+ return true; |
+ |
switch (GetGLImplementation()) { |
case kGLImplementationDesktopGL: |
if (!GLSurfaceGLX::InitializeOneOff()) { |