Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 std::unique_ptr<TestContextSupport> support); | 40 std::unique_ptr<TestContextSupport> support); |
| 41 static scoped_refptr<TestContextProvider> Create( | 41 static scoped_refptr<TestContextProvider> Create( |
| 42 std::unique_ptr<TestGLES2Interface> gl); | 42 std::unique_ptr<TestGLES2Interface> gl); |
| 43 | 43 |
| 44 bool BindToCurrentThread() override; | 44 bool BindToCurrentThread() override; |
| 45 void DetachFromThread() override; | 45 void DetachFromThread() override; |
| 46 gpu::Capabilities ContextCapabilities() override; | 46 gpu::Capabilities ContextCapabilities() override; |
| 47 gpu::gles2::GLES2Interface* ContextGL() override; | 47 gpu::gles2::GLES2Interface* ContextGL() override; |
| 48 gpu::ContextSupport* ContextSupport() override; | 48 gpu::ContextSupport* ContextSupport() override; |
| 49 class GrContext* GrContext() override; | 49 class GrContext* GrContext() override; |
| 50 ContextCacheController* CacheController() override; | |
| 50 void InvalidateGrContext(uint32_t state) override; | 51 void InvalidateGrContext(uint32_t state) override; |
| 51 base::Lock* GetLock() override; | 52 base::Lock* GetLock() override; |
| 52 void DeleteCachedResources() override; | |
| 53 void SetLostContextCallback(const LostContextCallback& cb) override; | 53 void SetLostContextCallback(const LostContextCallback& cb) override; |
| 54 | 54 |
| 55 TestWebGraphicsContext3D* TestContext3d(); | 55 TestWebGraphicsContext3D* TestContext3d(); |
| 56 | 56 |
| 57 // This returns the TestWebGraphicsContext3D but is valid to call | 57 // This returns the TestWebGraphicsContext3D but is valid to call |
| 58 // before the context is bound to a thread. This is needed to set up | 58 // before the context is bound to a thread. This is needed to set up |
| 59 // state on the test context before binding. Don't call | 59 // state on the test context before binding. Don't call |
| 60 // InitializeOnCurrentThread on the context returned from this method. | 60 // InitializeOnCurrentThread on the context returned from this method. |
| 61 TestWebGraphicsContext3D* UnboundTestContext3d(); | 61 TestWebGraphicsContext3D* UnboundTestContext3d(); |
| 62 | 62 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 78 bool bound_ = false; | 78 bool bound_ = false; |
| 79 | 79 |
| 80 base::ThreadChecker main_thread_checker_; | 80 base::ThreadChecker main_thread_checker_; |
| 81 base::ThreadChecker context_thread_checker_; | 81 base::ThreadChecker context_thread_checker_; |
| 82 | 82 |
| 83 base::Lock context_lock_; | 83 base::Lock context_lock_; |
| 84 | 84 |
| 85 LostContextCallback lost_context_callback_; | 85 LostContextCallback lost_context_callback_; |
| 86 sk_sp<class GrContext> gr_context_; | 86 sk_sp<class GrContext> gr_context_; |
| 87 | 87 |
| 88 std::unique_ptr<ContextCacheController> cache_controller_; | |
|
danakj
2016/08/26 23:49:08
Hm, kinda weird that gr_context_ and this are way
ericrk
2016/08/29 22:43:22
Done.
| |
| 89 | |
| 88 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; | 90 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); | 92 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace cc | 95 } // namespace cc |
| 94 | 96 |
| 95 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 97 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
| 96 | 98 |
| OLD | NEW |