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

Side by Side Diff: cc/test/fake_layer_tree_host.cc

Issue 1823773003: CC Animation: Add perf tests for AnimationHost with AnimationTimelines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rework. Created 4 years, 9 months 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/animation/animation_host_perftest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "cc/test/fake_layer_tree_host.h" 5 #include "cc/test/fake_layer_tree_host.h"
6 6
7 #include "cc/animation/animation_host.h"
7 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
8 #include "cc/test/fake_image_serialization_processor.h" 9 #include "cc/test/fake_image_serialization_processor.h"
9 #include "cc/test/test_task_graph_runner.h" 10 #include "cc/test/test_task_graph_runner.h"
10 11
11 namespace cc { 12 namespace cc {
12 FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client, 13 FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client,
13 LayerTreeHost::InitParams* params, 14 LayerTreeHost::InitParams* params,
14 CompositorMode mode) 15 CompositorMode mode)
15 : LayerTreeHost(params, mode), 16 : LayerTreeHost(params, mode),
16 client_(client), 17 client_(client),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return LayerTreeHost::GetRendererCapabilities(); 79 return LayerTreeHost::GetRendererCapabilities();
79 } 80 }
80 81
81 void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; } 82 void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; }
82 83
83 LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() { 84 LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() {
84 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree()); 85 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree());
85 active_tree()->SetPropertyTrees(*property_trees()); 86 active_tree()->SetPropertyTrees(*property_trees());
86 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(), 87 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(),
87 active_tree()); 88 active_tree());
89 animation_host()->PushPropertiesTo(host_impl_.animation_host());
88 90
89 active_tree()->UpdatePropertyTreeScrollOffset(property_trees()); 91 active_tree()->UpdatePropertyTreeScrollOffset(property_trees());
90 92
91 if (page_scale_layer() && inner_viewport_scroll_layer()) { 93 if (page_scale_layer() && inner_viewport_scroll_layer()) {
92 active_tree()->SetViewportLayersFromIds( 94 active_tree()->SetViewportLayersFromIds(
93 overscroll_elasticity_layer() ? overscroll_elasticity_layer()->id() 95 overscroll_elasticity_layer() ? overscroll_elasticity_layer()->id()
94 : Layer::INVALID_ID, 96 : Layer::INVALID_ID,
95 page_scale_layer()->id(), inner_viewport_scroll_layer()->id(), 97 page_scale_layer()->id(), inner_viewport_scroll_layer()->id(),
96 outer_viewport_scroll_layer() ? outer_viewport_scroll_layer()->id() 98 outer_viewport_scroll_layer() ? outer_viewport_scroll_layer()->id()
97 : Layer::INVALID_ID); 99 : Layer::INVALID_ID);
98 } 100 }
99 101
100 active_tree()->UpdatePropertyTreesForBoundsDelta(); 102 active_tree()->UpdatePropertyTreesForBoundsDelta();
101 return active_tree()->root_layer(); 103 return active_tree()->root_layer();
102 } 104 }
103 105
104 LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() { 106 LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() {
105 TreeSynchronizer::SynchronizeTrees(root_layer(), pending_tree()); 107 TreeSynchronizer::SynchronizeTrees(root_layer(), pending_tree());
106 pending_tree()->SetPropertyTrees(*property_trees()); 108 pending_tree()->SetPropertyTrees(*property_trees());
107 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(), 109 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(),
108 pending_tree()); 110 pending_tree());
111 animation_host()->PushPropertiesTo(host_impl_.animation_host());
112
109 pending_tree()->UpdatePropertyTreeScrollOffset(property_trees()); 113 pending_tree()->UpdatePropertyTreeScrollOffset(property_trees());
110 return pending_tree()->root_layer(); 114 return pending_tree()->root_layer();
111 } 115 }
112 116
113 } // namespace cc 117 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_host_perftest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698