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 "skia/ext/refptr.h" | 9 #include "skia/ext/refptr.h" |
10 | 10 |
11 class GrContext; | 11 class GrContext; |
12 | 12 |
13 namespace gpu { | 13 namespace gpu { |
14 class GLInProcessContext; | 14 class GLInProcessContext; |
15 } | 15 } |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 | 18 |
19 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext(); | 19 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext(); |
20 | 20 |
21 class TestInProcessContextProvider : public ContextProvider { | 21 class TestInProcessContextProvider : public ContextProvider { |
22 public: | 22 public: |
23 TestInProcessContextProvider(); | 23 TestInProcessContextProvider(); |
24 | 24 |
25 virtual bool BindToCurrentThread() OVERRIDE; | 25 virtual bool BindToCurrentThread() OVERRIDE; |
26 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; | 26 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; |
27 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; | 27 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; |
28 virtual class GrContext* GrContext() OVERRIDE; | 28 virtual class GrContext* GrContext() OVERRIDE; |
29 virtual void MakeGrContextCurrent() OVERRIDE; | |
30 virtual Capabilities ContextCapabilities() OVERRIDE; | 29 virtual Capabilities ContextCapabilities() OVERRIDE; |
31 virtual bool IsContextLost() OVERRIDE; | 30 virtual bool IsContextLost() OVERRIDE; |
32 virtual void VerifyContexts() OVERRIDE; | 31 virtual void VerifyContexts() OVERRIDE; |
33 virtual bool DestroyedOnMainThread() OVERRIDE; | 32 virtual bool DestroyedOnMainThread() OVERRIDE; |
34 virtual void SetLostContextCallback( | 33 virtual void SetLostContextCallback( |
35 const LostContextCallback& lost_context_callback) OVERRIDE; | 34 const LostContextCallback& lost_context_callback) OVERRIDE; |
36 virtual void SetMemoryPolicyChangedCallback( | 35 virtual void SetMemoryPolicyChangedCallback( |
37 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | 36 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
38 OVERRIDE; | 37 OVERRIDE; |
39 | 38 |
40 protected: | 39 protected: |
41 friend class base::RefCountedThreadSafe<TestInProcessContextProvider>; | 40 friend class base::RefCountedThreadSafe<TestInProcessContextProvider>; |
42 virtual ~TestInProcessContextProvider(); | 41 virtual ~TestInProcessContextProvider(); |
43 | 42 |
44 private: | 43 private: |
45 skia::RefPtr<class GrContext> gr_context_; | 44 skia::RefPtr<class GrContext> gr_context_; |
46 scoped_ptr<gpu::GLInProcessContext> context_; | 45 scoped_ptr<gpu::GLInProcessContext> context_; |
47 }; | 46 }; |
48 | 47 |
49 } // namespace cc | 48 } // namespace cc |
50 | 49 |
51 #endif // CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ | 50 #endif // CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
OLD | NEW |