| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) | 51 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) |
| 52 base::LazyInstance<base::Lock, | 52 base::LazyInstance<base::Lock, |
| 53 base::LeakyLazyInstanceTraits<base::Lock> > | 53 base::LeakyLazyInstanceTraits<base::Lock> > |
| 54 g_lock = LAZY_INSTANCE_INITIALIZER; | 54 g_lock = LAZY_INSTANCE_INITIALIZER; |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 } // namespace anonymous | 57 } // namespace anonymous |
| 58 | 58 |
| 59 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { | 59 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { |
| 60 #if !defined(USE_WAYLAND) | 60 #if !defined(USE_WAYLAND) |
| 61 impls->push_back(kGLImplementationOSMesaGL); | |
| 62 impls->push_back(kGLImplementationDesktopGL); | 61 impls->push_back(kGLImplementationDesktopGL); |
| 63 #endif | 62 #endif |
| 64 impls->push_back(kGLImplementationEGLGLES2); | 63 impls->push_back(kGLImplementationEGLGLES2); |
| 64 #if !defined(USE_WAYLAND) |
| 65 impls->push_back(kGLImplementationOSMesaGL); |
| 66 #endif |
| 65 } | 67 } |
| 66 | 68 |
| 67 bool InitializeGLBindings(GLImplementation implementation) { | 69 bool InitializeGLBindings(GLImplementation implementation) { |
| 68 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) | 70 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) |
| 69 base::AutoLock locked(g_lock.Get()); | 71 base::AutoLock locked(g_lock.Get()); |
| 70 #endif | 72 #endif |
| 71 // Prevent reinitialization with a different implementation. Once the gpu | 73 // Prevent reinitialization with a different implementation. Once the gpu |
| 72 // unit tests have initialized with kGLImplementationMock, we don't want to | 74 // unit tests have initialized with kGLImplementationMock, we don't want to |
| 73 // later switch to another GL implementation. | 75 // later switch to another GL implementation. |
| 74 if (GetGLImplementation() != kGLImplementationNone) | 76 if (GetGLImplementation() != kGLImplementationNone) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 #if !defined(USE_WAYLAND) | 233 #if !defined(USE_WAYLAND) |
| 232 ClearGLBindingsGLX(); | 234 ClearGLBindingsGLX(); |
| 233 ClearGLBindingsOSMESA(); | 235 ClearGLBindingsOSMESA(); |
| 234 #endif | 236 #endif |
| 235 SetGLImplementation(kGLImplementationNone); | 237 SetGLImplementation(kGLImplementationNone); |
| 236 | 238 |
| 237 UnloadGLNativeLibraries(); | 239 UnloadGLNativeLibraries(); |
| 238 } | 240 } |
| 239 | 241 |
| 240 } // namespace gfx | 242 } // namespace gfx |
| OLD | NEW |