Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: ui/gl/test/gl_surface_test_support.cc

Issue 2749873002: Move Ozone GPU initialization. (Closed)
Patch Set: Fixes. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/test/gl_image_test_support.cc ('k') | ui/ozone/public/ozone_platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gl/test/gl_image_test_support.cc ('k') | ui/ozone/public/ozone_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698