| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER |
| 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER | 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 26 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
| 27 class CONTENT_EXPORT ContextProviderCommandBuffer | 27 class CONTENT_EXPORT ContextProviderCommandBuffer |
| 28 : NON_EXPORTED_BASE(public webkit::gpu::ContextProviderWebContext) { | 28 : NON_EXPORTED_BASE(public webkit::gpu::ContextProviderWebContext) { |
| 29 public: | 29 public: |
| 30 static scoped_refptr<ContextProviderCommandBuffer> Create( | 30 static scoped_refptr<ContextProviderCommandBuffer> Create( |
| 31 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 31 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
| 32 const std::string& debug_name); | 32 const std::string& debug_name); |
| 33 | 33 |
| 34 CommandBufferProxyImpl* GetCommandBufferProxy(); | 34 CommandBufferProxyImpl* GetCommandBufferProxy(); |
| 35 | 35 |
| 36 void set_leak_on_destroy() { | |
| 37 base::AutoLock lock(main_thread_lock_); | |
| 38 leak_on_destroy_ = true; | |
| 39 } | |
| 40 | |
| 41 // ContextProviderWebContext implementation. | 36 // ContextProviderWebContext implementation. |
| 42 virtual WebGraphicsContext3DCommandBufferImpl* WebContext3D() OVERRIDE; | 37 virtual WebGraphicsContext3DCommandBufferImpl* WebContext3D() OVERRIDE; |
| 43 | 38 |
| 44 // cc::ContextProvider implementation. | 39 // cc::ContextProvider implementation. |
| 45 virtual bool BindToCurrentThread() OVERRIDE; | 40 virtual bool BindToCurrentThread() OVERRIDE; |
| 46 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; | 41 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; |
| 47 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; | 42 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; |
| 48 virtual class GrContext* GrContext() OVERRIDE; | 43 virtual class GrContext* GrContext() OVERRIDE; |
| 49 virtual Capabilities ContextCapabilities() OVERRIDE; | 44 virtual Capabilities ContextCapabilities() OVERRIDE; |
| 50 virtual bool IsContextLost() OVERRIDE; | 45 virtual bool IsContextLost() OVERRIDE; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 74 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 69 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
| 75 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; | 70 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; |
| 76 | 71 |
| 77 cc::ContextProvider::Capabilities capabilities_; | 72 cc::ContextProvider::Capabilities capabilities_; |
| 78 std::string debug_name_; | 73 std::string debug_name_; |
| 79 | 74 |
| 80 LostContextCallback lost_context_callback_; | 75 LostContextCallback lost_context_callback_; |
| 81 MemoryPolicyChangedCallback memory_policy_changed_callback_; | 76 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
| 82 | 77 |
| 83 base::Lock main_thread_lock_; | 78 base::Lock main_thread_lock_; |
| 84 bool leak_on_destroy_; | |
| 85 bool destroyed_; | 79 bool destroyed_; |
| 86 | 80 |
| 87 class LostContextCallbackProxy; | 81 class LostContextCallbackProxy; |
| 88 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 82 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
| 89 }; | 83 }; |
| 90 | 84 |
| 91 } // namespace content | 85 } // namespace content |
| 92 | 86 |
| 93 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER | 87 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER |
| OLD | NEW |