| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/animation_timelines_test_common.h" | 5 #include "cc/test/animation_timelines_test_common.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation_events.h" | 7 #include "cc/animation/animation_events.h" |
| 8 #include "cc/animation/animation_id_provider.h" | 8 #include "cc/animation/animation_id_provider.h" |
| 9 #include "cc/animation/animation_player.h" | 9 #include "cc/animation/animation_player.h" |
| 10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 gfx::ScrollOffset TestHostClient::GetScrollOffsetForAnimation( | 104 gfx::ScrollOffset TestHostClient::GetScrollOffsetForAnimation( |
| 105 int layer_id) const { | 105 int layer_id) const { |
| 106 return gfx::ScrollOffset(); | 106 return gfx::ScrollOffset(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void TestHostClient::RegisterLayer(int layer_id, LayerTreeType tree_type) { | 109 void TestHostClient::RegisterLayer(int layer_id, LayerTreeType tree_type) { |
| 110 LayerIdToTestLayer& layers_in_tree = tree_type == LayerTreeType::ACTIVE | 110 LayerIdToTestLayer& layers_in_tree = tree_type == LayerTreeType::ACTIVE |
| 111 ? layers_in_active_tree_ | 111 ? layers_in_active_tree_ |
| 112 : layers_in_pending_tree_; | 112 : layers_in_pending_tree_; |
| 113 DCHECK(layers_in_tree.find(layer_id) == layers_in_tree.end()); | 113 DCHECK(layers_in_tree.find(layer_id) == layers_in_tree.end()); |
| 114 layers_in_tree.add(layer_id, TestLayer::Create()); | 114 layers_in_tree[layer_id] = TestLayer::Create(); |
| 115 | 115 |
| 116 DCHECK(host_); | 116 DCHECK(host_); |
| 117 host_->RegisterLayer(layer_id, tree_type); | 117 host_->RegisterLayer(layer_id, tree_type); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void TestHostClient::UnregisterLayer(int layer_id, LayerTreeType tree_type) { | 120 void TestHostClient::UnregisterLayer(int layer_id, LayerTreeType tree_type) { |
| 121 DCHECK(host_); | 121 DCHECK(host_); |
| 122 host_->UnregisterLayer(layer_id, tree_type); | 122 host_->UnregisterLayer(layer_id, tree_type); |
| 123 | 123 |
| 124 LayerIdToTestLayer& layers_in_tree = tree_type == LayerTreeType::ACTIVE | 124 LayerIdToTestLayer& layers_in_tree = tree_type == LayerTreeType::ACTIVE |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 TestLayer* TestHostClient::FindTestLayer(int layer_id, | 166 TestLayer* TestHostClient::FindTestLayer(int layer_id, |
| 167 LayerTreeType tree_type) const { | 167 LayerTreeType tree_type) const { |
| 168 const LayerIdToTestLayer& layers_in_tree = tree_type == LayerTreeType::ACTIVE | 168 const LayerIdToTestLayer& layers_in_tree = tree_type == LayerTreeType::ACTIVE |
| 169 ? layers_in_active_tree_ | 169 ? layers_in_active_tree_ |
| 170 : layers_in_pending_tree_; | 170 : layers_in_pending_tree_; |
| 171 auto kv = layers_in_tree.find(layer_id); | 171 auto kv = layers_in_tree.find(layer_id); |
| 172 DCHECK(kv != layers_in_tree.end()); | 172 DCHECK(kv != layers_in_tree.end()); |
| 173 DCHECK(kv->second); | 173 DCHECK(kv->second); |
| 174 return kv->second; | 174 return kv->second.get(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 TestAnimationDelegate::TestAnimationDelegate() | 177 TestAnimationDelegate::TestAnimationDelegate() |
| 178 : started_(false), finished_(false) { | 178 : started_(false), finished_(false) { |
| 179 } | 179 } |
| 180 | 180 |
| 181 void TestAnimationDelegate::NotifyAnimationStarted( | 181 void TestAnimationDelegate::NotifyAnimationStarted( |
| 182 base::TimeTicks monotonic_time, | 182 base::TimeTicks monotonic_time, |
| 183 Animation::TargetProperty target_property, | 183 Animation::TargetProperty target_property, |
| 184 int group) { | 184 int group) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 return element_animations ? element_animations->players_list().head()->value() | 260 return element_animations ? element_animations->players_list().head()->value() |
| 261 : nullptr; | 261 : nullptr; |
| 262 } | 262 } |
| 263 | 263 |
| 264 int AnimationTimelinesTest::NextTestLayerId() { | 264 int AnimationTimelinesTest::NextTestLayerId() { |
| 265 next_test_layer_id_++; | 265 next_test_layer_id_++; |
| 266 return next_test_layer_id_; | 266 return next_test_layer_id_; |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace cc | 269 } // namespace cc |
| OLD | NEW |