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/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
12 #include "cc/trees/layer_tree_host_impl.h" | 12 #include "cc/trees/layer_tree_host_impl.h" |
13 #include "cc/trees/thread_proxy.h" | |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 namespace Webkit { | 16 namespace Webkit { |
16 class WebGraphicsContext3D; | 17 class WebGraphicsContext3D; |
17 } | 18 } |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 class FakeLayerTreeHostClient; | 21 class FakeLayerTreeHostClient; |
21 class FakeOutputSurface; | 22 class FakeOutputSurface; |
22 class LayerImpl; | 23 class LayerImpl; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 172 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
172 } | 173 } |
173 | 174 |
174 bool TestEnded() const { return ended_; } | 175 bool TestEnded() const { return ended_; } |
175 | 176 |
176 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 177 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
177 bool delegating_renderer() const { return delegating_renderer_; } | 178 bool delegating_renderer() const { return delegating_renderer_; } |
178 FakeOutputSurface* output_surface() { return output_surface_; } | 179 FakeOutputSurface* output_surface() { return output_surface_; } |
179 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; | 180 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; |
180 | 181 |
182 const ThreadProxy::MainThreadOnly& ThreadProxyMainOnly() const; | |
183 const ThreadProxy::CompositorThreadOnly& ThreadProxyImplOnly() const; | |
brianderson
2014/05/16 01:24:49
Instead of exposing these to all LayerTreeTests, c
simonhong
2014/05/16 03:00:09
Done.
| |
184 | |
181 void DestroyLayerTreeHost(); | 185 void DestroyLayerTreeHost(); |
182 | 186 |
183 // Override this for pixel tests, where you need a real output surface. | 187 // Override this for pixel tests, where you need a real output surface. |
184 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE; | 188 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE; |
185 // Override this for unit tests, which should not produce pixel output. | 189 // Override this for unit tests, which should not produce pixel output. |
186 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback); | 190 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback); |
187 | 191 |
188 TestWebGraphicsContext3D* TestContext(); | 192 TestWebGraphicsContext3D* TestContext(); |
189 | 193 |
190 | 194 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 | 288 |
285 #define SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ | 289 #define SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ |
286 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 290 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
287 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) | 291 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) |
288 | 292 |
289 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 293 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
290 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 294 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
291 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 295 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
292 | 296 |
293 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 297 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |