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 12 matching lines...) Expand all Loading... | |
23 | 23 |
24 // Implementation of cc::ContextProvider that provides a | 24 // Implementation of cc::ContextProvider that provides a |
25 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 25 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
26 class CONTENT_EXPORT ContextProviderCommandBuffer | 26 class CONTENT_EXPORT ContextProviderCommandBuffer |
27 : NON_EXPORTED_BASE(public cc::ContextProvider) { | 27 : NON_EXPORTED_BASE(public cc::ContextProvider) { |
28 public: | 28 public: |
29 static scoped_refptr<ContextProviderCommandBuffer> Create( | 29 static scoped_refptr<ContextProviderCommandBuffer> Create( |
30 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 30 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
31 const std::string& debug_name); | 31 const std::string& debug_name); |
32 | 32 |
33 CommandBufferProxyImpl* GetCommandBufferProxy(); | |
34 int GetGPUProcessID(); | |
no sievers
2014/01/07 16:36:51
Yea, I've been trying to remove this entirely :)
h
| |
35 | |
36 void set_leak_on_destroy() { | |
37 base::AutoLock lock(main_thread_lock_); | |
38 leak_on_destroy_ = true; | |
39 } | |
40 | |
41 // cc::ContextProvider implementation. | |
33 virtual bool BindToCurrentThread() OVERRIDE; | 42 virtual bool BindToCurrentThread() OVERRIDE; |
34 virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE; | 43 virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE; |
35 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; | 44 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; |
36 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; | 45 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; |
37 virtual class GrContext* GrContext() OVERRIDE; | 46 virtual class GrContext* GrContext() OVERRIDE; |
38 virtual void MakeGrContextCurrent() OVERRIDE; | 47 virtual void MakeGrContextCurrent() OVERRIDE; |
39 virtual Capabilities ContextCapabilities() OVERRIDE; | 48 virtual Capabilities ContextCapabilities() OVERRIDE; |
40 virtual bool IsContextLost() OVERRIDE; | 49 virtual bool IsContextLost() OVERRIDE; |
41 virtual void VerifyContexts() OVERRIDE; | 50 virtual void VerifyContexts() OVERRIDE; |
42 virtual bool DestroyedOnMainThread() OVERRIDE; | 51 virtual bool DestroyedOnMainThread() OVERRIDE; |
43 virtual void SetLostContextCallback( | 52 virtual void SetLostContextCallback( |
44 const LostContextCallback& lost_context_callback) OVERRIDE; | 53 const LostContextCallback& lost_context_callback) OVERRIDE; |
45 virtual void SetMemoryPolicyChangedCallback( | 54 virtual void SetMemoryPolicyChangedCallback( |
46 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | 55 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
47 OVERRIDE; | 56 OVERRIDE; |
48 | 57 |
49 void set_leak_on_destroy() { | |
50 base::AutoLock lock(main_thread_lock_); | |
51 leak_on_destroy_ = true; | |
52 } | |
53 | |
54 protected: | 58 protected: |
55 ContextProviderCommandBuffer( | 59 ContextProviderCommandBuffer( |
56 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 60 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
57 const std::string& debug_name); | 61 const std::string& debug_name); |
58 virtual ~ContextProviderCommandBuffer(); | 62 virtual ~ContextProviderCommandBuffer(); |
59 | 63 |
60 void OnLostContext(); | 64 void OnLostContext(); |
61 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); | 65 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); |
62 | 66 |
63 private: | 67 private: |
(...skipping 15 matching lines...) Expand all Loading... | |
79 bool leak_on_destroy_; | 83 bool leak_on_destroy_; |
80 bool destroyed_; | 84 bool destroyed_; |
81 | 85 |
82 class LostContextCallbackProxy; | 86 class LostContextCallbackProxy; |
83 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 87 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
84 }; | 88 }; |
85 | 89 |
86 } // namespace content | 90 } // namespace content |
87 | 91 |
88 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER | 92 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER |
OLD | NEW |