OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_LAYER_TREE_TEST_H_ | 5 #ifndef CC_TEST_LAYER_TREE_TEST_H_ |
6 #define CC_TEST_LAYER_TREE_TEST_H_ | 6 #define CC_TEST_LAYER_TREE_TEST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "cc/base/thread.h" | |
11 #include "cc/trees/layer_tree_host.h" | 10 #include "cc/trees/layer_tree_host.h" |
12 #include "cc/trees/layer_tree_host_impl.h" | 11 #include "cc/trees/layer_tree_host_impl.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "third_party/WebKit/public/platform/WebAnimationDelegate.h" | 13 #include "third_party/WebKit/public/platform/WebAnimationDelegate.h" |
15 | 14 |
16 namespace Webkit { | 15 namespace Webkit { |
17 class WebGraphicsContext3D; | 16 class WebGraphicsContext3D; |
18 } | 17 } |
19 | 18 |
20 namespace cc { | 19 namespace cc { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void DispatchSetNeedsRedraw(); | 132 void DispatchSetNeedsRedraw(); |
134 void DispatchSetNeedsRedrawRect(gfx::Rect damage_rect); | 133 void DispatchSetNeedsRedrawRect(gfx::Rect damage_rect); |
135 void DispatchSetVisible(bool visible); | 134 void DispatchSetVisible(bool visible); |
136 void DispatchComposite(); | 135 void DispatchComposite(); |
137 void DispatchDidAddAnimation(); | 136 void DispatchDidAddAnimation(); |
138 | 137 |
139 virtual void RunTest(bool threaded, | 138 virtual void RunTest(bool threaded, |
140 bool delegating_renderer, | 139 bool delegating_renderer, |
141 bool impl_side_painting); | 140 bool impl_side_painting); |
142 | 141 |
143 Thread* ImplThread() { return proxy() ? proxy()->ImplThread() : NULL; } | 142 bool HasImplThread() { return proxy() ? proxy()->HasImplThread() : false; } |
| 143 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
| 144 return proxy() ? proxy()->ImplThreadTaskRunner() : NULL; |
| 145 } |
144 Proxy* proxy() const { | 146 Proxy* proxy() const { |
145 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 147 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
146 } | 148 } |
147 | 149 |
148 bool TestEnded() const { return ended_; } | 150 bool TestEnded() const { return ended_; } |
149 | 151 |
150 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 152 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
151 bool delegating_renderer() const { return delegating_renderer_; } | 153 bool delegating_renderer() const { return delegating_renderer_; } |
152 | 154 |
153 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE; | 155 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
165 bool end_when_begin_returns_; | 167 bool end_when_begin_returns_; |
166 bool timed_out_; | 168 bool timed_out_; |
167 bool scheduled_; | 169 bool scheduled_; |
168 bool schedule_when_set_visible_true_; | 170 bool schedule_when_set_visible_true_; |
169 bool started_; | 171 bool started_; |
170 bool ended_; | 172 bool ended_; |
171 bool delegating_renderer_; | 173 bool delegating_renderer_; |
172 | 174 |
173 int timeout_seconds_; | 175 int timeout_seconds_; |
174 | 176 |
175 scoped_ptr<Thread> main_ccthread_; | 177 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
176 scoped_ptr<base::Thread> impl_thread_; | 178 scoped_ptr<base::Thread> impl_thread_; |
177 base::CancelableClosure timeout_; | 179 base::CancelableClosure timeout_; |
178 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; | 180 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; |
179 base::WeakPtrFactory<LayerTreeTest> weak_factory_; | 181 base::WeakPtrFactory<LayerTreeTest> weak_factory_; |
180 scoped_refptr<FakeContextProvider> main_thread_contexts_; | 182 scoped_refptr<FakeContextProvider> main_thread_contexts_; |
181 scoped_refptr<FakeContextProvider> compositor_thread_contexts_; | 183 scoped_refptr<FakeContextProvider> compositor_thread_contexts_; |
182 }; | 184 }; |
183 | 185 |
184 } // namespace cc | 186 } // namespace cc |
185 | 187 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 231 |
230 #define SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \ | 232 #define SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \ |
231 SINGLE_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 233 SINGLE_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
232 MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 234 MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
233 | 235 |
234 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 236 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
235 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 237 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
236 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 238 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
237 | 239 |
238 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 240 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |