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" |
11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
14 #include "cc/test/test_context_support.h" | 14 #include "cc/test/test_context_support.h" |
15 #include "gpu/command_buffer/client/gles2_interface_stub.h" | 15 #include "gpu/command_buffer/client/gles2_interface_stub.h" |
16 | 16 |
17 namespace blink { class WebGraphicsContext3D; } | |
18 | |
19 namespace cc { | 17 namespace cc { |
20 class TestWebGraphicsContext3D; | 18 class TestWebGraphicsContext3D; |
21 class TestGLES2Interface; | 19 class TestGLES2Interface; |
22 | 20 |
23 class TestContextProvider : public ContextProvider { | 21 class TestContextProvider : public ContextProvider { |
24 public: | 22 public: |
25 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> | 23 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> |
26 CreateCallback; | 24 CreateCallback; |
27 | 25 |
28 static scoped_refptr<TestContextProvider> Create(); | 26 static scoped_refptr<TestContextProvider> Create(); |
29 static scoped_refptr<TestContextProvider> Create( | 27 static scoped_refptr<TestContextProvider> Create( |
30 scoped_ptr<TestWebGraphicsContext3D> context); | 28 scoped_ptr<TestWebGraphicsContext3D> context); |
31 | 29 |
32 virtual bool BindToCurrentThread() OVERRIDE; | 30 virtual bool BindToCurrentThread() OVERRIDE; |
33 virtual Capabilities ContextCapabilities() OVERRIDE; | 31 virtual Capabilities ContextCapabilities() OVERRIDE; |
34 virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE; | |
35 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; | 32 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; |
36 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; | 33 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; |
37 virtual class GrContext* GrContext() OVERRIDE; | 34 virtual class GrContext* GrContext() OVERRIDE; |
38 virtual void MakeGrContextCurrent() OVERRIDE; | 35 virtual void MakeGrContextCurrent() OVERRIDE; |
39 virtual bool IsContextLost() OVERRIDE; | 36 virtual bool IsContextLost() OVERRIDE; |
40 virtual void VerifyContexts() OVERRIDE; | 37 virtual void VerifyContexts() OVERRIDE; |
41 virtual bool DestroyedOnMainThread() OVERRIDE; | 38 virtual bool DestroyedOnMainThread() OVERRIDE; |
42 virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE; | 39 virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE; |
43 virtual void SetMemoryPolicyChangedCallback( | 40 virtual void SetMemoryPolicyChangedCallback( |
44 const MemoryPolicyChangedCallback& cb) OVERRIDE; | 41 const MemoryPolicyChangedCallback& cb) OVERRIDE; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 81 |
85 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; | 82 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; |
86 | 83 |
87 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); | 84 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); |
88 }; | 85 }; |
89 | 86 |
90 } // namespace cc | 87 } // namespace cc |
91 | 88 |
92 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 89 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
93 | 90 |
OLD | NEW |