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 #include "skia/ext/refptr.h" |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 class TestWebGraphicsContext3D; | 19 class TestWebGraphicsContext3D; |
19 class TestGLES2Interface; | 20 class TestGLES2Interface; |
20 | 21 |
21 class TestContextProvider : public ContextProvider { | 22 class TestContextProvider : public ContextProvider { |
22 public: | 23 public: |
23 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> | 24 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> |
24 CreateCallback; | 25 CreateCallback; |
25 | 26 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool bound_; | 69 bool bound_; |
69 | 70 |
70 base::ThreadChecker main_thread_checker_; | 71 base::ThreadChecker main_thread_checker_; |
71 base::ThreadChecker context_thread_checker_; | 72 base::ThreadChecker context_thread_checker_; |
72 | 73 |
73 base::Lock destroyed_lock_; | 74 base::Lock destroyed_lock_; |
74 bool destroyed_; | 75 bool destroyed_; |
75 | 76 |
76 LostContextCallback lost_context_callback_; | 77 LostContextCallback lost_context_callback_; |
77 MemoryPolicyChangedCallback memory_policy_changed_callback_; | 78 MemoryPolicyChangedCallback memory_policy_changed_callback_; |
| 79 skia::RefPtr<class GrContext> gr_context_; |
78 | 80 |
79 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; | 81 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; |
80 | 82 |
81 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); | 83 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); |
82 }; | 84 }; |
83 | 85 |
84 } // namespace cc | 86 } // namespace cc |
85 | 87 |
86 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 88 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
87 | 89 |
OLD | NEW |