| 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 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 34 if (GetGLImplementation() != kGLImplementationNone) |
| 35 return true; |
| 35 | 36 |
| 36 // Allow the main thread or another to initialize these bindings | 37 // Allow the main thread or another to initialize these bindings |
| 37 // after instituting restrictions on I/O. Going forward they will | 38 // after instituting restrictions on I/O. Going forward they will |
| 38 // likely be used in the browser process on most platforms. The | 39 // likely be used in the browser process on most platforms. The |
| 39 // one-time initialization cost is small, between 2 and 5 ms. | 40 // one-time initialization cost is small, between 2 and 5 ms. |
| 40 base::ThreadRestrictions::ScopedAllowIO allow_io; | 41 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 41 | 42 |
| 42 switch (implementation) { | 43 switch (implementation) { |
| 43 case kGLImplementationOSMesaGL: { | 44 case kGLImplementationOSMesaGL: { |
| 44 // osmesa.so is located in the build directory. This code path is only | 45 // 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... |
| 146 SetGLImplementation(kGLImplementationNone); | 147 SetGLImplementation(kGLImplementationNone); |
| 147 | 148 |
| 148 UnloadGLNativeLibraries(); | 149 UnloadGLNativeLibraries(); |
| 149 } | 150 } |
| 150 | 151 |
| 151 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { | 152 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { |
| 152 return false; | 153 return false; |
| 153 } | 154 } |
| 154 | 155 |
| 155 } // namespace gfx | 156 } // namespace gfx |
| OLD | NEW |