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" |
(...skipping 14 matching lines...) Expand all Loading... |
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 #endif |
| 35 |
| 36 #if defined(USE_OZONE) |
| 37 ui::OzonePlatform::InitParams params; |
| 38 params.single_process = true; |
| 39 ui::OzonePlatform::InitializeForGPU(params); |
| 40 #endif |
| 41 |
35 ui::test::EnableTestConfigForPlatformWindows(); | 42 ui::test::EnableTestConfigForPlatformWindows(); |
36 | 43 |
37 bool use_software_gl = true; | 44 bool use_software_gl = true; |
38 | 45 |
39 // We usually use software GL as this works on all bots. The | 46 // We usually use software GL as this works on all bots. The |
40 // command line can override this behaviour to use hardware GL. | 47 // command line can override this behaviour to use hardware GL. |
41 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 48 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
42 switches::kUseGpuInTests)) { | 49 switches::kUseGpuInTests)) { |
43 use_software_gl = false; | 50 use_software_gl = false; |
44 } | 51 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool gpu_service_logging = false; | 88 bool gpu_service_logging = false; |
82 bool disable_gl_drawing = false; | 89 bool disable_gl_drawing = false; |
83 | 90 |
84 CHECK(init::InitializeGLOneOffImplementation( | 91 CHECK(init::InitializeGLOneOffImplementation( |
85 impl, fallback_to_software_gl, gpu_service_logging, disable_gl_drawing)); | 92 impl, fallback_to_software_gl, gpu_service_logging, disable_gl_drawing)); |
86 } | 93 } |
87 | 94 |
88 // static | 95 // static |
89 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { | 96 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { |
90 #if defined(USE_OZONE) | 97 #if defined(USE_OZONE) |
91 // This function skips where Ozone is otherwise initialized. | 98 ui::OzonePlatform::InitParams params; |
92 ui::OzonePlatform::InitializeForGPU(); | 99 params.single_process = true; |
| 100 ui::OzonePlatform::InitializeForGPU(params); |
93 #endif | 101 #endif |
| 102 |
94 InitializeOneOffImplementation(kGLImplementationMockGL, false); | 103 InitializeOneOffImplementation(kGLImplementationMockGL, false); |
95 } | 104 } |
96 | 105 |
97 void GLSurfaceTestSupport::InitializeOneOffWithStubBindings() { | 106 void GLSurfaceTestSupport::InitializeOneOffWithStubBindings() { |
98 #if defined(USE_OZONE) | 107 #if defined(USE_OZONE) |
99 // This function skips where Ozone is otherwise initialized. | 108 ui::OzonePlatform::InitParams params; |
100 ui::OzonePlatform::InitializeForGPU(); | 109 params.single_process = true; |
| 110 ui::OzonePlatform::InitializeForGPU(params); |
101 #endif | 111 #endif |
| 112 |
102 InitializeOneOffImplementation(kGLImplementationStubGL, false); | 113 InitializeOneOffImplementation(kGLImplementationStubGL, false); |
103 } | 114 } |
104 | 115 |
105 } // namespace gl | 116 } // namespace gl |
OLD | NEW |