| 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 virtual bool BindToCurrentThread() override; | 30 virtual bool BindToCurrentThread() override; |
| 26 virtual gpu::gles2::GLES2Interface* ContextGL() override; | 31 virtual gpu::gles2::GLES2Interface* ContextGL() override; |
| 27 virtual gpu::ContextSupport* ContextSupport() override; | 32 virtual gpu::ContextSupport* ContextSupport() override; |
| 28 virtual class GrContext* GrContext() override; | 33 virtual class GrContext* GrContext() override; |
| 29 virtual Capabilities ContextCapabilities() override; | 34 virtual Capabilities ContextCapabilities() override; |
| 30 virtual bool IsContextLost() override; | 35 virtual bool IsContextLost() override; |
| 31 virtual void VerifyContexts() override; | 36 virtual void VerifyContexts() override; |
| 32 virtual void DeleteCachedResources() override; | 37 virtual void DeleteCachedResources() override; |
| 33 virtual bool DestroyedOnMainThread() override; | 38 virtual bool DestroyedOnMainThread() override; |
| 34 virtual void SetLostContextCallback( | 39 virtual void SetLostContextCallback( |
| 35 const LostContextCallback& lost_context_callback) override; | 40 const LostContextCallback& lost_context_callback) override; |
| 36 virtual void SetMemoryPolicyChangedCallback( | 41 virtual 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 virtual ~TestInProcessContextProvider(); | 47 virtual ~TestInProcessContextProvider(); |
| 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 |