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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 gpu::gles2::GLES2Interface* ContextGL() override; | 34 gpu::gles2::GLES2Interface* ContextGL() override; |
35 gpu::ContextSupport* ContextSupport() override; | 35 gpu::ContextSupport* ContextSupport() override; |
36 class GrContext* GrContext() override; | 36 class GrContext* GrContext() override; |
37 void InvalidateGrContext(uint32_t state) override; | 37 void InvalidateGrContext(uint32_t state) override; |
38 void SetupLock() override; | 38 void SetupLock() override; |
39 base::Lock* GetLock() override; | 39 base::Lock* GetLock() override; |
40 void VerifyContexts() override; | 40 void VerifyContexts() override; |
41 void DeleteCachedResources() override; | 41 void DeleteCachedResources() override; |
42 bool DestroyedOnMainThread() override; | 42 bool DestroyedOnMainThread() override; |
43 void SetLostContextCallback(const LostContextCallback& cb) override; | 43 void SetLostContextCallback(const LostContextCallback& cb) override; |
44 void SetMemoryPolicyChangedCallback( | |
45 const MemoryPolicyChangedCallback& cb) override; | |
46 | 44 |
47 TestWebGraphicsContext3D* TestContext3d(); | 45 TestWebGraphicsContext3D* TestContext3d(); |
48 | 46 |
49 // This returns the TestWebGraphicsContext3D but is valid to call | 47 // This returns the TestWebGraphicsContext3D but is valid to call |
50 // before the context is bound to a thread. This is needed to set up | 48 // before the context is bound to a thread. This is needed to set up |
51 // state on the test context before binding. Don't call | 49 // state on the test context before binding. Don't call |
52 // InitializeOnCurrentThread on the context returned from this method. | 50 // InitializeOnCurrentThread on the context returned from this method. |
53 TestWebGraphicsContext3D* UnboundTestContext3d(); | 51 TestWebGraphicsContext3D* UnboundTestContext3d(); |
54 | 52 |
55 TestContextSupport* support() { return &support_; } | 53 TestContextSupport* support() { return &support_; } |
(...skipping 17 matching lines...) Expand all Loading... | |
73 | 71 |
74 base::ThreadChecker main_thread_checker_; | 72 base::ThreadChecker main_thread_checker_; |
75 base::ThreadChecker context_thread_checker_; | 73 base::ThreadChecker context_thread_checker_; |
76 | 74 |
77 base::Lock destroyed_lock_; | 75 base::Lock destroyed_lock_; |
78 bool destroyed_; | 76 bool destroyed_; |
79 | 77 |
80 base::Lock context_lock_; | 78 base::Lock context_lock_; |
81 | 79 |
82 LostContextCallback lost_context_callback_; | 80 LostContextCallback lost_context_callback_; |
83 MemoryPolicyChangedCallback memory_policy_changed_callback_; | 81 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
piman
2015/09/24 21:34:08
nit: remove
sohanjg
2015/09/28 07:35:49
Done.
| |
84 skia::RefPtr<class GrContext> gr_context_; | 82 skia::RefPtr<class GrContext> gr_context_; |
85 | 83 |
86 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; | 84 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; |
87 | 85 |
88 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); | 86 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); |
89 }; | 87 }; |
90 | 88 |
91 } // namespace cc | 89 } // namespace cc |
92 | 90 |
93 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 91 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
94 | 92 |
OLD | NEW |