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

Side by Side Diff: ui/gl/gl_surface.cc

Issue 261013004: Allow use of EGL in browser tests with --use-gl=egl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: egl-browsertests: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | ui/gl/gl_switches.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 24 matching lines...) Expand all
35 35
36 std::vector<GLImplementation> allowed_impls; 36 std::vector<GLImplementation> allowed_impls;
37 GetAllowedGLImplementations(&allowed_impls); 37 GetAllowedGLImplementations(&allowed_impls);
38 DCHECK(!allowed_impls.empty()); 38 DCHECK(!allowed_impls.empty());
39 39
40 CommandLine* cmd = CommandLine::ForCurrentProcess(); 40 CommandLine* cmd = CommandLine::ForCurrentProcess();
41 41
42 // The default implementation is always the first one in list. 42 // The default implementation is always the first one in list.
43 GLImplementation impl = allowed_impls[0]; 43 GLImplementation impl = allowed_impls[0];
44 bool fallback_to_osmesa = false; 44 bool fallback_to_osmesa = false;
45 if (cmd->HasSwitch(switches::kUseGL)) { 45 if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) {
46 impl = kGLImplementationOSMesaGL;
47 } else if (cmd->HasSwitch(switches::kUseGL)) {
46 std::string requested_implementation_name = 48 std::string requested_implementation_name =
47 cmd->GetSwitchValueASCII(switches::kUseGL); 49 cmd->GetSwitchValueASCII(switches::kUseGL);
48 if (requested_implementation_name == "any") { 50 if (requested_implementation_name == "any") {
49 fallback_to_osmesa = true; 51 fallback_to_osmesa = true;
50 } else if (requested_implementation_name == "swiftshader") { 52 } else if (requested_implementation_name == "swiftshader") {
51 impl = kGLImplementationEGLGLES2; 53 impl = kGLImplementationEGLGLES2;
52 } else { 54 } else {
53 impl = GetNamedGLImplementation(requested_implementation_name); 55 impl = GetNamedGLImplementation(requested_implementation_name);
54 if (std::find(allowed_impls.begin(), 56 if (std::find(allowed_impls.begin(),
55 allowed_impls.end(), 57 allowed_impls.end(),
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 return surface_->GetFormat(); 330 return surface_->GetFormat();
329 } 331 }
330 332
331 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { 333 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() {
332 return surface_->GetVSyncProvider(); 334 return surface_->GetVSyncProvider();
333 } 335 }
334 336
335 GLSurfaceAdapter::~GLSurfaceAdapter() {} 337 GLSurfaceAdapter::~GLSurfaceAdapter() {}
336 338
337 } // namespace gfx 339 } // namespace gfx
OLDNEW
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698