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/gl/gl_context.h" | 12 #include "ui/gl/gl_context.h" |
13 #include "ui/gl/gl_implementation.h" | 13 #include "ui/gl/gl_implementation.h" |
14 #include "ui/gl/gl_switches.h" | 14 #include "ui/gl/gl_switches.h" |
15 #include "ui/gl/init/gl_factory.h" | 15 #include "ui/gl/init/gl_factory.h" |
16 | 16 |
| 17 #if defined(USE_OZONE) |
| 18 #include "ui/ozone/public/ozone_platform.h" |
| 19 #endif |
| 20 |
17 #if defined(USE_X11) | 21 #if defined(USE_X11) |
18 #include <X11/Xlib.h> | 22 #include <X11/Xlib.h> |
19 #include "ui/platform_window/x11/x11_window.h" | 23 #include "ui/platform_window/x11/x11_window.h" |
20 #endif | 24 #endif |
21 | 25 |
22 namespace gl { | 26 namespace gl { |
23 | 27 |
24 // static | 28 // static |
25 void GLSurfaceTestSupport::InitializeOneOff() { | 29 void GLSurfaceTestSupport::InitializeOneOff() { |
26 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 30 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 80 |
77 bool gpu_service_logging = false; | 81 bool gpu_service_logging = false; |
78 bool disable_gl_drawing = false; | 82 bool disable_gl_drawing = false; |
79 | 83 |
80 CHECK(init::InitializeGLOneOffImplementation( | 84 CHECK(init::InitializeGLOneOffImplementation( |
81 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); | 85 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); |
82 } | 86 } |
83 | 87 |
84 // static | 88 // static |
85 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { | 89 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { |
| 90 #if defined(USE_OZONE) |
| 91 // This function skips where Ozone is otherwise initialized. |
| 92 ui::OzonePlatform::InitializeForGPU(); |
| 93 #endif |
86 InitializeOneOffImplementation(kGLImplementationMockGL, false); | 94 InitializeOneOffImplementation(kGLImplementationMockGL, false); |
87 } | 95 } |
88 | 96 |
89 } // namespace gl | 97 } // namespace gl |
OLD | NEW |