| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 return library; | 42 return library; |
| 43 } | 43 } |
| 44 | 44 |
| 45 base::NativeLibrary LoadLibrary(const char* filename) { | 45 base::NativeLibrary LoadLibrary(const char* filename) { |
| 46 return LoadLibrary(FilePath(filename)); | 46 return LoadLibrary(FilePath(filename)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // TODO(backer): Find a more principled (less heavy handed) way to prevent a | 49 // TODO(backer): Find a more principled (less heavy handed) way to prevent a |
| 50 // race in the bindings initialization. | 50 // race in the bindings initialization. |
| 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> g_lock(base::LINKER_INITIALIZED); | 52 base::LazyInstance<base::Lock, |
| 53 base::LeakyLazyInstanceTraits<base::Lock> > |
| 54 g_lock(base::LINKER_INITIALIZED); |
| 53 #endif | 55 #endif |
| 54 | 56 |
| 55 } // namespace anonymous | 57 } // namespace anonymous |
| 56 | 58 |
| 57 bool InitializeGLBindings(GLImplementation implementation) { | 59 bool InitializeGLBindings(GLImplementation implementation) { |
| 58 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) | 60 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) |
| 59 base::AutoLock locked(g_lock.Get()); | 61 base::AutoLock locked(g_lock.Get()); |
| 60 #endif | 62 #endif |
| 61 // Prevent reinitialization with a different implementation. Once the gpu | 63 // Prevent reinitialization with a different implementation. Once the gpu |
| 62 // unit tests have initialized with kGLImplementationMock, we don't want to | 64 // unit tests have initialized with kGLImplementationMock, we don't want to |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void InitializeDebugGLBindings() { | 209 void InitializeDebugGLBindings() { |
| 208 InitializeDebugGLBindingsEGL(); | 210 InitializeDebugGLBindingsEGL(); |
| 209 InitializeDebugGLBindingsGL(); | 211 InitializeDebugGLBindingsGL(); |
| 210 #if !defined(USE_WAYLAND) | 212 #if !defined(USE_WAYLAND) |
| 211 InitializeDebugGLBindingsGLX(); | 213 InitializeDebugGLBindingsGLX(); |
| 212 InitializeDebugGLBindingsOSMESA(); | 214 InitializeDebugGLBindingsOSMESA(); |
| 213 #endif | 215 #endif |
| 214 } | 216 } |
| 215 | 217 |
| 216 } // namespace gfx | 218 } // namespace gfx |
| OLD | NEW |