| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |