| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gl/test/gl_surface_test_support.h" | 5 #include "ui/gl/test/gl_surface_test_support.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/gl/gl_context.h" | 9 #include "ui/gl/gl_context.h" |
| 10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
| 11 #include "ui/gl/gl_surface.h" | 11 #include "ui/gl/gl_surface.h" |
| 12 #include "ui/gl/gl_switches.h" | 12 #include "ui/gl/gl_switches.h" |
| 13 | 13 |
| 14 #if defined(USE_X11) | 14 #if defined(USE_X11) |
| 15 #include <X11/Xlib.h> | 15 #include <X11/Xlib.h> |
| 16 #include "ui/platform_window/x11/x11_window.h" |
| 16 #endif | 17 #endif |
| 17 | 18 |
| 18 namespace gfx { | 19 namespace gfx { |
| 19 | 20 |
| 20 // static | 21 // static |
| 21 void GLSurfaceTestSupport::InitializeOneOff() { | 22 void GLSurfaceTestSupport::InitializeOneOff() { |
| 22 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 23 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
| 23 | 24 |
| 24 #if defined(USE_X11) | 25 #if defined(USE_X11) |
| 25 XInitThreads(); | 26 XInitThreads(); |
| 27 ui::test::SetUseOverrideRedirectWindowByDefault(true); |
| 26 #endif | 28 #endif |
| 27 | 29 |
| 28 bool use_osmesa = true; | 30 bool use_osmesa = true; |
| 29 | 31 |
| 30 // We usually use OSMesa as this works on all bots. The command line can | 32 // We usually use OSMesa as this works on all bots. The command line can |
| 31 // override this behaviour to use hardware GL. | 33 // override this behaviour to use hardware GL. |
| 32 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 34 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 33 switches::kUseGpuInTests)) { | 35 switches::kUseGpuInTests)) { |
| 34 use_osmesa = false; | 36 use_osmesa = false; |
| 35 } | 37 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 kGLImplementationMockGL, fallback_to_osmesa, gpu_service_logging, | 77 kGLImplementationMockGL, fallback_to_osmesa, gpu_service_logging, |
| 76 disable_gl_drawing)); | 78 disable_gl_drawing)); |
| 77 } | 79 } |
| 78 | 80 |
| 79 // static | 81 // static |
| 80 void GLSurfaceTestSupport::InitializeDynamicMockBindings(GLContext* context) { | 82 void GLSurfaceTestSupport::InitializeDynamicMockBindings(GLContext* context) { |
| 81 CHECK(InitializeDynamicGLBindings(kGLImplementationMockGL, context)); | 83 CHECK(InitializeDynamicGLBindings(kGLImplementationMockGL, context)); |
| 82 } | 84 } |
| 83 | 85 |
| 84 } // namespace gfx | 86 } // namespace gfx |
| OLD | NEW |