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

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

Issue 2189233003: Move last of platform dependent init from //ui/gl to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix return values. Created 4 years, 4 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') | no next file » | 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 26 matching lines...) Expand all
37 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 37 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
38 switches::kUseGpuInTests)) { 38 switches::kUseGpuInTests)) {
39 use_osmesa = false; 39 use_osmesa = false;
40 } 40 }
41 41
42 #if defined(OS_ANDROID) 42 #if defined(OS_ANDROID)
43 // On Android we always use hardware GL. 43 // On Android we always use hardware GL.
44 use_osmesa = false; 44 use_osmesa = false;
45 #endif 45 #endif
46 46
47 std::vector<GLImplementation> allowed_impls; 47 std::vector<GLImplementation> allowed_impls =
48 GetAllowedGLImplementations(&allowed_impls); 48 init::GetAllowedGLImplementations();
49 DCHECK(!allowed_impls.empty()); 49 DCHECK(!allowed_impls.empty());
50 50
51 GLImplementation impl = allowed_impls[0]; 51 GLImplementation impl = allowed_impls[0];
52 if (use_osmesa) 52 if (use_osmesa)
53 impl = kGLImplementationOSMesaGL; 53 impl = kGLImplementationOSMesaGL;
54 54
55 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) 55 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL))
56 << "kUseGL has not effect in tests"; 56 << "kUseGL has not effect in tests";
57 57
58 bool fallback_to_osmesa = false; 58 bool fallback_to_osmesa = false;
(...skipping 21 matching lines...) Expand all
80 CHECK(init::InitializeGLOneOffImplementation( 80 CHECK(init::InitializeGLOneOffImplementation(
81 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); 81 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing));
82 } 82 }
83 83
84 // static 84 // static
85 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { 85 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() {
86 InitializeOneOffImplementation(kGLImplementationMockGL, false); 86 InitializeOneOffImplementation(kGLImplementationMockGL, false);
87 } 87 }
88 88
89 } // namespace gl 89 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/test/gl_image_test_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698