OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
6 #define CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 6 #define CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 static scoped_refptr<TestContextProvider> Create(); | 25 static scoped_refptr<TestContextProvider> Create(); |
26 static scoped_refptr<TestContextProvider> Create( | 26 static scoped_refptr<TestContextProvider> Create( |
27 scoped_ptr<TestWebGraphicsContext3D> context); | 27 scoped_ptr<TestWebGraphicsContext3D> context); |
28 | 28 |
29 virtual bool BindToCurrentThread() OVERRIDE; | 29 virtual bool BindToCurrentThread() OVERRIDE; |
30 virtual Capabilities ContextCapabilities() OVERRIDE; | 30 virtual Capabilities ContextCapabilities() OVERRIDE; |
31 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | 31 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
32 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; | 32 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; |
33 virtual class GrContext* GrContext() OVERRIDE; | 33 virtual class GrContext* GrContext() OVERRIDE; |
| 34 virtual bool IsContextLost() OVERRIDE; |
34 virtual void VerifyContexts() OVERRIDE; | 35 virtual void VerifyContexts() OVERRIDE; |
35 virtual bool DestroyedOnMainThread() OVERRIDE; | 36 virtual bool DestroyedOnMainThread() OVERRIDE; |
36 virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE; | 37 virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE; |
37 virtual void SetSwapBuffersCompleteCallback( | 38 virtual void SetSwapBuffersCompleteCallback( |
38 const SwapBuffersCompleteCallback& cb) OVERRIDE; | 39 const SwapBuffersCompleteCallback& cb) OVERRIDE; |
39 virtual void SetMemoryPolicyChangedCallback( | 40 virtual void SetMemoryPolicyChangedCallback( |
40 const MemoryPolicyChangedCallback& cb) OVERRIDE; | 41 const MemoryPolicyChangedCallback& cb) OVERRIDE; |
41 | 42 |
42 TestWebGraphicsContext3D* TestContext3d(); | 43 TestWebGraphicsContext3D* TestContext3d(); |
43 | 44 |
(...skipping 17 matching lines...) Expand all Loading... |
61 TestContextSupport support_; | 62 TestContextSupport support_; |
62 | 63 |
63 scoped_ptr<TestWebGraphicsContext3D> context3d_; | 64 scoped_ptr<TestWebGraphicsContext3D> context3d_; |
64 bool bound_; | 65 bool bound_; |
65 | 66 |
66 base::ThreadChecker main_thread_checker_; | 67 base::ThreadChecker main_thread_checker_; |
67 base::ThreadChecker context_thread_checker_; | 68 base::ThreadChecker context_thread_checker_; |
68 | 69 |
69 base::Lock destroyed_lock_; | 70 base::Lock destroyed_lock_; |
70 bool destroyed_; | 71 bool destroyed_; |
| 72 bool context_lost_; |
71 | 73 |
72 LostContextCallback lost_context_callback_; | 74 LostContextCallback lost_context_callback_; |
73 SwapBuffersCompleteCallback swap_buffers_complete_callback_; | 75 SwapBuffersCompleteCallback swap_buffers_complete_callback_; |
74 MemoryPolicyChangedCallback memory_policy_changed_callback_; | 76 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
75 | 77 |
76 class LostContextCallbackProxy; | 78 class LostContextCallbackProxy; |
77 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 79 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
78 | 80 |
79 class SwapBuffersCompleteCallbackProxy; | 81 class SwapBuffersCompleteCallbackProxy; |
80 scoped_ptr<SwapBuffersCompleteCallbackProxy> | 82 scoped_ptr<SwapBuffersCompleteCallbackProxy> |
81 swap_buffers_complete_callback_proxy_; | 83 swap_buffers_complete_callback_proxy_; |
82 }; | 84 }; |
83 | 85 |
84 } // namespace cc | 86 } // namespace cc |
85 | 87 |
86 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 88 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
87 | 89 |
OLD | NEW |