OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "cc/animation/animation_curve.h" | 7 #include "cc/animation/animation_curve.h" |
8 #include "cc/animation/layer_animation_controller.h" | 8 #include "cc/animation/layer_animation_controller.h" |
9 #include "cc/animation/scroll_offset_animation_curve.h" | 9 #include "cc/animation/scroll_offset_animation_curve.h" |
10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1246 host_impl->pending_tree()->source_frame_number() != 2) | 1246 host_impl->pending_tree()->source_frame_number() != 2) |
1247 return; | 1247 return; |
1248 | 1248 |
1249 frame_count_with_pending_tree_++; | 1249 frame_count_with_pending_tree_++; |
1250 if (frame_count_with_pending_tree_ == 2) | 1250 if (frame_count_with_pending_tree_ == 2) |
1251 host_impl->BlockNotifyReadyToActivateForTesting(false); | 1251 host_impl->BlockNotifyReadyToActivateForTesting(false); |
1252 } | 1252 } |
1253 | 1253 |
1254 virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl, | 1254 virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl, |
1255 bool has_unfinished_animation) OVERRIDE { | 1255 bool has_unfinished_animation) OVERRIDE { |
1256 Animation* root_animation = host_impl->active_tree() | 1256 LayerAnimationController* root_controller_impl = |
1257 ->root_layer() | 1257 host_impl->active_tree()->root_layer()->layer_animation_controller(); |
1258 ->layer_animation_controller() | 1258 Animation* root_animation = |
1259 ->GetAnimation(Animation::Opacity); | 1259 root_controller_impl->GetAnimation(Animation::Opacity); |
1260 if (!root_animation || root_animation->run_state() != Animation::Running) | 1260 if (!root_animation || root_animation->run_state() != Animation::Running) |
1261 return; | 1261 return; |
1262 | 1262 |
1263 Animation* child_animation = host_impl->active_tree() | 1263 LayerAnimationController* child_controller_impl = |
1264 ->root_layer() | 1264 host_impl->active_tree()->root_layer()->children() |
1265 ->children()[0] | 1265 [0]->layer_animation_controller(); |
ajuma
2014/07/09 14:23:54
Weird line breaking, but that's how git cl format
| |
1266 ->layer_animation_controller() | 1266 Animation* child_animation = |
1267 ->GetAnimation(Animation::Opacity); | 1267 child_controller_impl->GetAnimation(Animation::Opacity); |
1268 EXPECT_EQ(Animation::Running, child_animation->run_state()); | 1268 EXPECT_EQ(Animation::Running, child_animation->run_state()); |
1269 EXPECT_EQ(root_animation->start_time(), child_animation->start_time()); | 1269 EXPECT_EQ(root_animation->start_time(), child_animation->start_time()); |
1270 root_controller_impl->AbortAnimations(Animation::Opacity); | |
1271 root_controller_impl->AbortAnimations(Animation::Transform); | |
1272 child_controller_impl->AbortAnimations(Animation::Opacity); | |
1270 EndTest(); | 1273 EndTest(); |
1271 } | 1274 } |
1272 | 1275 |
1273 virtual void AfterTest() OVERRIDE {} | 1276 virtual void AfterTest() OVERRIDE {} |
1274 | 1277 |
1275 private: | 1278 private: |
1276 int frame_count_with_pending_tree_; | 1279 int frame_count_with_pending_tree_; |
1277 }; | 1280 }; |
1278 | 1281 |
1279 SINGLE_AND_MULTI_THREAD_TEST_F( | 1282 SINGLE_AND_MULTI_THREAD_TEST_F( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1339 private: | 1342 private: |
1340 scoped_refptr<Layer> content_; | 1343 scoped_refptr<Layer> content_; |
1341 int num_swap_buffers_; | 1344 int num_swap_buffers_; |
1342 }; | 1345 }; |
1343 | 1346 |
1344 SINGLE_AND_MULTI_THREAD_TEST_F( | 1347 SINGLE_AND_MULTI_THREAD_TEST_F( |
1345 LayerTreeHostAnimationTestAddAnimationAfterAnimating); | 1348 LayerTreeHostAnimationTestAddAnimationAfterAnimating); |
1346 | 1349 |
1347 } // namespace | 1350 } // namespace |
1348 } // namespace cc | 1351 } // namespace cc |
OLD | NEW |