Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: cc/test/layer_tree_test.h

Issue 1449133002: TaskGraphRunner refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/raster/tile_task_worker_pool_perftest.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/layers/layer_settings.h" 11 #include "cc/layers/layer_settings.h"
12 #include "cc/trees/layer_tree_host.h" 12 #include "cc/trees/layer_tree_host.h"
13 #include "cc/trees/layer_tree_host_impl.h" 13 #include "cc/trees/layer_tree_host_impl.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace cc { 16 namespace cc {
17 class AnimationPlayer; 17 class AnimationPlayer;
18 class FakeExternalBeginFrameSource; 18 class FakeExternalBeginFrameSource;
19 class FakeLayerTreeHostClient; 19 class FakeLayerTreeHostClient;
20 class FakeOutputSurface; 20 class FakeOutputSurface;
21 class LayerImpl; 21 class LayerImpl;
22 class LayerTreeHost; 22 class LayerTreeHost;
23 class LayerTreeHostClient; 23 class LayerTreeHostClient;
24 class LayerTreeHostImpl; 24 class LayerTreeHostImpl;
25 class TestContextProvider; 25 class TestContextProvider;
26 class TestGpuMemoryBufferManager; 26 class TestGpuMemoryBufferManager;
27 class TestTaskGraphRunner;
27 class TestWebGraphicsContext3D; 28 class TestWebGraphicsContext3D;
28 29
29 // Creates the virtual viewport layer hierarchy under the given root_layer. 30 // Creates the virtual viewport layer hierarchy under the given root_layer.
30 // Convenient overload of the method below that creates a scrolling layer as 31 // Convenient overload of the method below that creates a scrolling layer as
31 // the outer viewport scroll layer. 32 // the outer viewport scroll layer.
32 void CreateVirtualViewportLayers(Layer* root_layer, 33 void CreateVirtualViewportLayers(Layer* root_layer,
33 const gfx::Size& inner_bounds, 34 const gfx::Size& inner_bounds,
34 const gfx::Size& outer_bounds, 35 const gfx::Size& outer_bounds,
35 const gfx::Size& scroll_bounds, 36 const gfx::Size& scroll_bounds,
36 LayerTreeHost* host, 37 LayerTreeHost* host,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 base::SingleThreadTaskRunner* MainThreadTaskRunner() { 264 base::SingleThreadTaskRunner* MainThreadTaskRunner() {
264 return main_task_runner_.get(); 265 return main_task_runner_.get();
265 } 266 }
266 Proxy* proxy() const { 267 Proxy* proxy() const {
267 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; 268 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL;
268 } 269 }
269 TaskRunnerProvider* task_runner_provider() const { 270 TaskRunnerProvider* task_runner_provider() const {
270 return layer_tree_host_ ? layer_tree_host_->task_runner_provider() 271 return layer_tree_host_ ? layer_tree_host_->task_runner_provider()
271 : nullptr; 272 : nullptr;
272 } 273 }
273 TaskGraphRunner* task_graph_runner() const { 274 TaskGraphRunner* task_graph_runner() const;
274 return task_graph_runner_.get();
275 }
276
277 bool TestEnded() const { return ended_; } 275 bool TestEnded() const { return ended_; }
278 276
279 LayerTreeHost* layer_tree_host(); 277 LayerTreeHost* layer_tree_host();
280 bool delegating_renderer() const { return delegating_renderer_; } 278 bool delegating_renderer() const { return delegating_renderer_; }
281 FakeOutputSurface* output_surface() { return output_surface_; } 279 FakeOutputSurface* output_surface() { return output_surface_; }
282 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; 280 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const;
283 281
284 void DestroyLayerTreeHost(); 282 void DestroyLayerTreeHost();
285 283
286 // By default, output surface recreation is synchronous. 284 // By default, output surface recreation is synchronous.
(...skipping 26 matching lines...) Expand all
313 bool ended_; 311 bool ended_;
314 bool delegating_renderer_; 312 bool delegating_renderer_;
315 bool verify_property_trees_; 313 bool verify_property_trees_;
316 314
317 int timeout_seconds_; 315 int timeout_seconds_;
318 316
319 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 317 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
320 scoped_ptr<base::Thread> impl_thread_; 318 scoped_ptr<base::Thread> impl_thread_;
321 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; 319 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
322 scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; 320 scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
323 scoped_ptr<TaskGraphRunner> task_graph_runner_; 321 scoped_ptr<TestTaskGraphRunner> task_graph_runner_;
324 base::CancelableClosure timeout_; 322 base::CancelableClosure timeout_;
325 scoped_refptr<TestContextProvider> compositor_contexts_; 323 scoped_refptr<TestContextProvider> compositor_contexts_;
326 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; 324 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_;
327 base::WeakPtrFactory<LayerTreeTest> weak_factory_; 325 base::WeakPtrFactory<LayerTreeTest> weak_factory_;
328 }; 326 };
329 327
330 } // namespace cc 328 } // namespace cc
331 329
332 #define SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \ 330 #define SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
333 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer) { \ 331 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer) { \
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ 370 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \
373 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ 371 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
374 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) 372 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
375 373
376 // Some tests want to control when notify ready for activation occurs, 374 // Some tests want to control when notify ready for activation occurs,
377 // but this is not supported in the single-threaded case. 375 // but this is not supported in the single-threaded case.
378 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ 376 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \
379 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) 377 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME)
380 378
381 #endif // CC_TEST_LAYER_TREE_TEST_H_ 379 #endif // CC_TEST_LAYER_TREE_TEST_H_
OLDNEW
« no previous file with comments | « cc/raster/tile_task_worker_pool_perftest.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698