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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { | 24 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { |
25 impls->push_back(kGLImplementationDesktopGL); | 25 impls->push_back(kGLImplementationDesktopGL); |
26 impls->push_back(kGLImplementationAppleGL); | 26 impls->push_back(kGLImplementationAppleGL); |
27 impls->push_back(kGLImplementationOSMesaGL); | 27 impls->push_back(kGLImplementationOSMesaGL); |
28 } | 28 } |
29 | 29 |
30 bool InitializeStaticGLBindings(GLImplementation implementation) { | 30 bool InitializeStaticGLBindings(GLImplementation implementation) { |
31 // Prevent reinitialization with a different implementation. Once the gpu | 31 // Prevent reinitialization with a different implementation. Once the gpu |
32 // unit tests have initialized with kGLImplementationMock, we don't want to | 32 // unit tests have initialized with kGLImplementationMock, we don't want to |
33 // later switch to another GL implementation. | 33 // later switch to another GL implementation. |
34 if (GetGLImplementation() != kGLImplementationNone) | 34 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
35 return true; | |
36 | 35 |
37 // Allow the main thread or another to initialize these bindings | 36 // Allow the main thread or another to initialize these bindings |
38 // after instituting restrictions on I/O. Going forward they will | 37 // after instituting restrictions on I/O. Going forward they will |
39 // likely be used in the browser process on most platforms. The | 38 // likely be used in the browser process on most platforms. The |
40 // one-time initialization cost is small, between 2 and 5 ms. | 39 // one-time initialization cost is small, between 2 and 5 ms. |
41 base::ThreadRestrictions::ScopedAllowIO allow_io; | 40 base::ThreadRestrictions::ScopedAllowIO allow_io; |
42 | 41 |
43 switch (implementation) { | 42 switch (implementation) { |
44 case kGLImplementationOSMesaGL: { | 43 case kGLImplementationOSMesaGL: { |
45 // osmesa.so is located in the build directory. This code path is only | 44 // osmesa.so is located in the build directory. This code path is only |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 SetGLImplementation(kGLImplementationNone); | 146 SetGLImplementation(kGLImplementationNone); |
148 | 147 |
149 UnloadGLNativeLibraries(); | 148 UnloadGLNativeLibraries(); |
150 } | 149 } |
151 | 150 |
152 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { | 151 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { |
153 return false; | 152 return false; |
154 } | 153 } |
155 | 154 |
156 } // namespace gfx | 155 } // namespace gfx |
OLD | NEW |