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_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
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 30 matching lines...) Expand all Loading... | |
41 class GrContext* GrContext() override; | 41 class GrContext* GrContext() override; |
42 void InvalidateGrContext(uint32_t state) override; | 42 void InvalidateGrContext(uint32_t state) override; |
43 void SetupLock() override; | 43 void SetupLock() override; |
44 base::Lock* GetLock() override; | 44 base::Lock* GetLock() override; |
45 Capabilities ContextCapabilities() override; | 45 Capabilities ContextCapabilities() override; |
46 void VerifyContexts() override; | 46 void VerifyContexts() override; |
47 void DeleteCachedResources() override; | 47 void DeleteCachedResources() override; |
48 bool DestroyedOnMainThread() override; | 48 bool DestroyedOnMainThread() override; |
49 void SetLostContextCallback( | 49 void SetLostContextCallback( |
50 const LostContextCallback& lost_context_callback) override; | 50 const LostContextCallback& lost_context_callback) override; |
51 void SetMemoryPolicyChangedCallback( | |
52 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | |
53 override; | |
54 | 51 |
55 protected: | 52 protected: |
56 ContextProviderCommandBuffer( | 53 ContextProviderCommandBuffer( |
57 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 54 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
58 CommandBufferContextType type); | 55 CommandBufferContextType type); |
59 ~ContextProviderCommandBuffer() override; | 56 ~ContextProviderCommandBuffer() override; |
60 | 57 |
61 void OnLostContext(); | 58 void OnLostContext(); |
62 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); | 59 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); |
63 | 60 |
64 private: | 61 private: |
65 void InitializeCapabilities(); | 62 void InitializeCapabilities(); |
66 | 63 |
67 base::ThreadChecker main_thread_checker_; | 64 base::ThreadChecker main_thread_checker_; |
68 base::ThreadChecker context_thread_checker_; | 65 base::ThreadChecker context_thread_checker_; |
69 | 66 |
70 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 67 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
71 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; | 68 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; |
72 | 69 |
73 cc::ContextProvider::Capabilities capabilities_; | 70 cc::ContextProvider::Capabilities capabilities_; |
74 CommandBufferContextType context_type_; | 71 CommandBufferContextType context_type_; |
75 std::string debug_name_; | 72 std::string debug_name_; |
76 | 73 |
77 LostContextCallback lost_context_callback_; | 74 LostContextCallback lost_context_callback_; |
78 MemoryPolicyChangedCallback memory_policy_changed_callback_; | 75 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
piman
2015/09/24 21:34:08
nit: remove.
sohanjg
2015/09/28 07:35:49
Done.
| |
79 | 76 |
80 base::Lock main_thread_lock_; | 77 base::Lock main_thread_lock_; |
81 bool destroyed_; | 78 bool destroyed_; |
82 | 79 |
83 base::Lock context_lock_; | 80 base::Lock context_lock_; |
84 | 81 |
85 class LostContextCallbackProxy; | 82 class LostContextCallbackProxy; |
86 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 83 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
87 }; | 84 }; |
88 | 85 |
89 } // namespace content | 86 } // namespace content |
90 | 87 |
91 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 88 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |