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 "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
8 | 8 |
9 #include "third_party/khronos/GLES2/gl2.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "content/renderer/gpu/gpu_channel_host.h" | 30 #include "content/renderer/gpu/gpu_channel_host.h" |
31 #include "content/renderer/render_thread_impl.h" | 31 #include "content/renderer/render_thread_impl.h" |
32 #include "content/renderer/render_view_impl.h" | 32 #include "content/renderer/render_view_impl.h" |
33 #include "gpu/command_buffer/client/gles2_implementation.h" | 33 #include "gpu/command_buffer/client/gles2_implementation.h" |
34 #include "gpu/command_buffer/common/constants.h" | 34 #include "gpu/command_buffer/common/constants.h" |
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
38 #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" | 38 #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" |
39 | 39 |
40 static base::LazyInstance<base::Lock, | 40 static base::LazyInstance<base::Lock>::Leaky |
41 base::LeakyLazyInstanceTraits<base::Lock> > | |
42 g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; | 41 g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; |
43 static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > | 42 static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > |
44 g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; | 43 g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; |
45 | 44 |
46 namespace { | 45 namespace { |
47 | 46 |
48 void ClearSharedContexts() { | 47 void ClearSharedContexts() { |
49 base::AutoLock lock(g_all_shared_contexts_lock.Get()); | 48 base::AutoLock lock(g_all_shared_contexts_lock.Get()); |
50 g_all_shared_contexts.Pointer()->clear(); | 49 g_all_shared_contexts.Pointer()->clear(); |
51 } | 50 } |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 } | 1203 } |
1205 if (attributes_.shareResources) | 1204 if (attributes_.shareResources) |
1206 ClearSharedContexts(); | 1205 ClearSharedContexts(); |
1207 RenderViewImpl* renderview = | 1206 RenderViewImpl* renderview = |
1208 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; | 1207 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; |
1209 if (renderview) | 1208 if (renderview) |
1210 renderview->OnViewContextSwapBuffersAborted(); | 1209 renderview->OnViewContextSwapBuffersAborted(); |
1211 } | 1210 } |
1212 | 1211 |
1213 #endif // defined(ENABLE_GPU) | 1212 #endif // defined(ENABLE_GPU) |
OLD | NEW |