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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
8 | 8 |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 namespace { | 200 namespace { |
201 | 201 |
202 const int32 kCommandBufferSize = 1024 * 1024; | 202 const int32 kCommandBufferSize = 1024 * 1024; |
203 // TODO(kbr): make the transfer buffer size configurable via context | 203 // TODO(kbr): make the transfer buffer size configurable via context |
204 // creation attributes. | 204 // creation attributes. |
205 const int32 kTransferBufferSize = 1024 * 1024; | 205 const int32 kTransferBufferSize = 1024 * 1024; |
206 | 206 |
207 static base::LazyInstance< | 207 static base::LazyInstance< |
208 std::set<WebGraphicsContext3DInProcessCommandBufferImpl*> > | 208 std::set<WebGraphicsContext3DInProcessCommandBufferImpl*> > |
209 g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; | 209 g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; |
210 static base::LazyInstance<base::Lock, | 210 static base::LazyInstance<base::Lock>::Leaky |
211 base::LeakyLazyInstanceTraits<base::Lock> > | |
212 g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; | 211 g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; |
213 | 212 |
214 // Singleton used to initialize and terminate the gles2 library. | 213 // Singleton used to initialize and terminate the gles2 library. |
215 class GLES2Initializer { | 214 class GLES2Initializer { |
216 public: | 215 public: |
217 GLES2Initializer() { | 216 GLES2Initializer() { |
218 gles2::Initialize(); | 217 gles2::Initialize(); |
219 } | 218 } |
220 | 219 |
221 ~GLES2Initializer() { | 220 ~GLES2Initializer() { |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 1669 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
1671 if (context_lost_callback_) { | 1670 if (context_lost_callback_) { |
1672 context_lost_callback_->onContextLost(); | 1671 context_lost_callback_->onContextLost(); |
1673 } | 1672 } |
1674 } | 1673 } |
1675 | 1674 |
1676 } // namespace gpu | 1675 } // namespace gpu |
1677 } // namespace webkit | 1676 } // namespace webkit |
1678 | 1677 |
1679 #endif // defined(ENABLE_GPU) | 1678 #endif // defined(ENABLE_GPU) |
OLD | NEW |