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

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

Issue 2690113010: Abstract OSMesa from the Layout tests (Closed)
Patch Set: Renamed "Renderer" to "GL" Created 3 years, 10 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/gl_implementation.h ('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_implementation.h" 5 #include "ui/gl/gl_implementation.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 GLImplementation GetNamedGLImplementation(const std::string& name) { 74 GLImplementation GetNamedGLImplementation(const std::string& name) {
75 for (size_t i = 0; i < arraysize(kGLImplementationNamePairs); ++i) { 75 for (size_t i = 0; i < arraysize(kGLImplementationNamePairs); ++i) {
76 if (name == kGLImplementationNamePairs[i].name) 76 if (name == kGLImplementationNamePairs[i].name)
77 return kGLImplementationNamePairs[i].implementation; 77 return kGLImplementationNamePairs[i].implementation;
78 } 78 }
79 79
80 return kGLImplementationNone; 80 return kGLImplementationNone;
81 } 81 }
82 82
83 GLImplementation GetSoftwareGLImplementation() {
84 return kGLImplementationOSMesaGL;
85 }
86
83 const char* GetGLImplementationName(GLImplementation implementation) { 87 const char* GetGLImplementationName(GLImplementation implementation) {
84 for (size_t i = 0; i < arraysize(kGLImplementationNamePairs); ++i) { 88 for (size_t i = 0; i < arraysize(kGLImplementationNamePairs); ++i) {
85 if (implementation == kGLImplementationNamePairs[i].implementation) 89 if (implementation == kGLImplementationNamePairs[i].implementation)
86 return kGLImplementationNamePairs[i].name; 90 return kGLImplementationNamePairs[i].name;
87 } 91 }
88 92
89 return "unknown"; 93 return "unknown";
90 } 94 }
91 95
92 void SetGLImplementation(GLImplementation implementation) { 96 void SetGLImplementation(GLImplementation implementation) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); 243 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error);
240 if (!library) { 244 if (!library) {
241 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " 245 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": "
242 << error.ToString(); 246 << error.ToString();
243 return NULL; 247 return NULL;
244 } 248 }
245 return library; 249 return library;
246 } 250 }
247 251
248 } // namespace gl 252 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation.h ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698