| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "ui/base/platform_window_defaults.h" |
| 12 #include "ui/gl/gl_context.h" | 13 #include "ui/gl/gl_context.h" |
| 13 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 14 #include "ui/gl/gl_switches.h" | 15 #include "ui/gl/gl_switches.h" |
| 15 #include "ui/gl/init/gl_factory.h" | 16 #include "ui/gl/init/gl_factory.h" |
| 16 | 17 |
| 17 #if defined(USE_OZONE) | 18 #if defined(USE_OZONE) |
| 18 #include "ui/ozone/public/ozone_platform.h" | 19 #include "ui/ozone/public/ozone_platform.h" |
| 19 #endif | 20 #endif |
| 20 | 21 |
| 21 #if defined(USE_X11) | 22 #if defined(USE_X11) |
| 22 #include <X11/Xlib.h> | 23 #include <X11/Xlib.h> |
| 23 #include "ui/platform_window/x11/x11_window.h" | |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 namespace gl { | 26 namespace gl { |
| 27 | 27 |
| 28 // static | 28 // static |
| 29 void GLSurfaceTestSupport::InitializeOneOff() { | 29 void GLSurfaceTestSupport::InitializeOneOff() { |
| 30 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 30 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
| 31 | 31 |
| 32 #if defined(USE_X11) | 32 #if defined(USE_X11) |
| 33 XInitThreads(); | 33 XInitThreads(); |
| 34 #endif |
| 34 ui::test::SetUseOverrideRedirectWindowByDefault(true); | 35 ui::test::SetUseOverrideRedirectWindowByDefault(true); |
| 35 #endif | |
| 36 | 36 |
| 37 bool use_osmesa = true; | 37 bool use_osmesa = true; |
| 38 | 38 |
| 39 // We usually use OSMesa as this works on all bots. The command line can | 39 // We usually use OSMesa as this works on all bots. The command line can |
| 40 // override this behaviour to use hardware GL. | 40 // override this behaviour to use hardware GL. |
| 41 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 41 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 42 switches::kUseGpuInTests)) { | 42 switches::kUseGpuInTests)) { |
| 43 use_osmesa = false; | 43 use_osmesa = false; |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 void GLSurfaceTestSupport::InitializeOneOffWithStubBindings() { | 97 void GLSurfaceTestSupport::InitializeOneOffWithStubBindings() { |
| 98 #if defined(USE_OZONE) | 98 #if defined(USE_OZONE) |
| 99 // This function skips where Ozone is otherwise initialized. | 99 // This function skips where Ozone is otherwise initialized. |
| 100 ui::OzonePlatform::InitializeForGPU(); | 100 ui::OzonePlatform::InitializeForGPU(); |
| 101 #endif | 101 #endif |
| 102 InitializeOneOffImplementation(kGLImplementationStubGL, false); | 102 InitializeOneOffImplementation(kGLImplementationStubGL, false); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace gl | 105 } // namespace gl |
| OLD | NEW |