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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 if (!library) { | 44 if (!library) { |
45 library = base::LoadNativeLibrary(module_path.Append(name), NULL); | 45 library = base::LoadNativeLibrary(module_path.Append(name), NULL); |
46 if (!library) { | 46 if (!library) { |
47 DVLOG(1) << name << " not found."; | 47 DVLOG(1) << name << " not found."; |
48 return false; | 48 return false; |
49 } | 49 } |
50 } | 50 } |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 } // namespace anonymous | 54 } // namespace |
55 | 55 |
56 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { | 56 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { |
57 impls->push_back(kGLImplementationEGLGLES2); | 57 impls->push_back(kGLImplementationEGLGLES2); |
58 impls->push_back(kGLImplementationDesktopGL); | 58 impls->push_back(kGLImplementationDesktopGL); |
59 impls->push_back(kGLImplementationOSMesaGL); | 59 impls->push_back(kGLImplementationOSMesaGL); |
60 } | 60 } |
61 | 61 |
62 bool InitializeGLBindings(GLImplementation implementation) { | 62 bool InitializeGLBindings(GLImplementation implementation) { |
63 // Prevent reinitialization with a different implementation. Once the gpu | 63 // Prevent reinitialization with a different implementation. Once the gpu |
64 // unit tests have initialized with kGLImplementationMock, we don't want to | 64 // unit tests have initialized with kGLImplementationMock, we don't want to |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 void ClearGLBindings() { | 261 void ClearGLBindings() { |
262 ClearGLBindingsEGL(); | 262 ClearGLBindingsEGL(); |
263 ClearGLBindingsGL(); | 263 ClearGLBindingsGL(); |
264 ClearGLBindingsOSMESA(); | 264 ClearGLBindingsOSMESA(); |
265 ClearGLBindingsWGL(); | 265 ClearGLBindingsWGL(); |
266 SetGLImplementation(kGLImplementationNone); | 266 SetGLImplementation(kGLImplementationNone); |
267 UnloadGLNativeLibraries(); | 267 UnloadGLNativeLibraries(); |
268 } | 268 } |
269 | 269 |
270 } // namespace gfx | 270 } // namespace gfx |
OLD | NEW |