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 28 matching lines...) Expand all Loading... |
39 gpu::gles2::GLES2Interface* ContextGL() override; | 39 gpu::gles2::GLES2Interface* ContextGL() override; |
40 gpu::ContextSupport* ContextSupport() override; | 40 gpu::ContextSupport* ContextSupport() override; |
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 DeleteCachedResources() override; | 46 void DeleteCachedResources() override; |
47 void SetLostContextCallback( | 47 void SetLostContextCallback( |
48 const LostContextCallback& lost_context_callback) override; | 48 const LostContextCallback& lost_context_callback) override; |
| 49 void SetMemoryPolicyChangedCallback( |
| 50 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
| 51 override; |
49 | 52 |
50 protected: | 53 protected: |
51 ContextProviderCommandBuffer( | 54 ContextProviderCommandBuffer( |
52 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 55 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
53 CommandBufferContextType type); | 56 CommandBufferContextType type); |
54 ~ContextProviderCommandBuffer() override; | 57 ~ContextProviderCommandBuffer() override; |
55 | 58 |
56 void OnLostContext(); | 59 void OnLostContext(); |
| 60 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation); |
57 | 61 |
58 private: | 62 private: |
59 void InitializeCapabilities(); | 63 void InitializeCapabilities(); |
60 | 64 |
61 base::ThreadChecker main_thread_checker_; | 65 base::ThreadChecker main_thread_checker_; |
62 base::ThreadChecker context_thread_checker_; | 66 base::ThreadChecker context_thread_checker_; |
63 | 67 |
64 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 68 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
65 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; | 69 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; |
66 | 70 |
67 cc::ContextProvider::Capabilities capabilities_; | 71 cc::ContextProvider::Capabilities capabilities_; |
68 CommandBufferContextType context_type_; | 72 CommandBufferContextType context_type_; |
69 std::string debug_name_; | 73 std::string debug_name_; |
70 | 74 |
71 LostContextCallback lost_context_callback_; | 75 LostContextCallback lost_context_callback_; |
| 76 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
72 | 77 |
73 base::Lock context_lock_; | 78 base::Lock context_lock_; |
74 | 79 |
75 class LostContextCallbackProxy; | 80 class LostContextCallbackProxy; |
76 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 81 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
77 }; | 82 }; |
78 | 83 |
79 } // namespace content | 84 } // namespace content |
80 | 85 |
81 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 86 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |