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_IN_PROCESS_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
6 #define CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ | 6 #define CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
| 9 #include "cc/test/test_gpu_memory_buffer_manager.h" |
| 10 #include "cc/test/test_image_factory.h" |
9 #include "skia/ext/refptr.h" | 11 #include "skia/ext/refptr.h" |
10 | 12 |
11 class GrContext; | 13 class GrContext; |
12 | 14 |
13 namespace gpu { | 15 namespace gpu { |
14 class GLInProcessContext; | 16 class GLInProcessContext; |
15 } | 17 } |
16 | 18 |
17 namespace cc { | 19 namespace cc { |
18 | 20 |
19 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext(); | 21 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext(); |
| 22 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext( |
| 23 TestGpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 24 TestImageFactory* image_factory); |
20 | 25 |
21 class TestInProcessContextProvider : public ContextProvider { | 26 class TestInProcessContextProvider : public ContextProvider { |
22 public: | 27 public: |
23 TestInProcessContextProvider(); | 28 TestInProcessContextProvider(); |
24 | 29 |
25 bool BindToCurrentThread() override; | 30 bool BindToCurrentThread() override; |
26 gpu::gles2::GLES2Interface* ContextGL() override; | 31 gpu::gles2::GLES2Interface* ContextGL() override; |
27 gpu::ContextSupport* ContextSupport() override; | 32 gpu::ContextSupport* ContextSupport() override; |
28 class GrContext* GrContext() override; | 33 class GrContext* GrContext() override; |
29 Capabilities ContextCapabilities() override; | 34 Capabilities ContextCapabilities() override; |
30 bool IsContextLost() override; | 35 bool IsContextLost() override; |
31 void VerifyContexts() override; | 36 void VerifyContexts() override; |
32 void DeleteCachedResources() override; | 37 void DeleteCachedResources() override; |
33 bool DestroyedOnMainThread() override; | 38 bool DestroyedOnMainThread() override; |
34 void SetLostContextCallback( | 39 void SetLostContextCallback( |
35 const LostContextCallback& lost_context_callback) override; | 40 const LostContextCallback& lost_context_callback) override; |
36 void SetMemoryPolicyChangedCallback( | 41 void SetMemoryPolicyChangedCallback( |
37 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | 42 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
38 override; | 43 override; |
39 | 44 |
40 protected: | 45 protected: |
41 friend class base::RefCountedThreadSafe<TestInProcessContextProvider>; | 46 friend class base::RefCountedThreadSafe<TestInProcessContextProvider>; |
42 ~TestInProcessContextProvider() override; | 47 ~TestInProcessContextProvider() override; |
43 | 48 |
44 private: | 49 private: |
| 50 TestGpuMemoryBufferManager gpu_memory_buffer_manager_; |
| 51 TestImageFactory image_factory_; |
45 scoped_ptr<gpu::GLInProcessContext> context_; | 52 scoped_ptr<gpu::GLInProcessContext> context_; |
46 skia::RefPtr<class GrContext> gr_context_; | 53 skia::RefPtr<class GrContext> gr_context_; |
47 }; | 54 }; |
48 | 55 |
49 } // namespace cc | 56 } // namespace cc |
50 | 57 |
51 #endif // CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ | 58 #endif // CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
OLD | NEW |