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/animation/element_animations.h" | 5 #include "cc/animation/element_animations.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 ->curve() | 560 ->curve() |
561 ->ToScrollOffsetAnimationCurve() | 561 ->ToScrollOffsetAnimationCurve() |
562 ->HasSetInitialValue()) { | 562 ->HasSetInitialValue()) { |
563 gfx::ScrollOffset current_scroll_offset; | 563 gfx::ScrollOffset current_scroll_offset; |
564 if (element_animations_impl->has_element_in_active_list()) { | 564 if (element_animations_impl->has_element_in_active_list()) { |
565 current_scroll_offset = | 565 current_scroll_offset = |
566 element_animations_impl->ScrollOffsetForAnimation(); | 566 element_animations_impl->ScrollOffsetForAnimation(); |
567 } else { | 567 } else { |
568 // The owning layer isn't yet in the active tree, so the main thread | 568 // The owning layer isn't yet in the active tree, so the main thread |
569 // scroll offset will be up-to-date. | 569 // scroll offset will be up-to-date. |
| 570 DCHECK(has_element_in_active_list()); |
570 current_scroll_offset = ScrollOffsetForAnimation(); | 571 current_scroll_offset = ScrollOffsetForAnimation(); |
571 } | 572 } |
572 animations_[i]->curve()->ToScrollOffsetAnimationCurve()->SetInitialValue( | 573 animations_[i]->curve()->ToScrollOffsetAnimationCurve()->SetInitialValue( |
573 current_scroll_offset); | 574 current_scroll_offset); |
574 } | 575 } |
575 | 576 |
576 // The new animation should be set to run as soon as possible. | 577 // The new animation should be set to run as soon as possible. |
577 Animation::RunState initial_run_state = | 578 Animation::RunState initial_run_state = |
578 Animation::WAITING_FOR_TARGET_AVAILABILITY; | 579 Animation::WAITING_FOR_TARGET_AVAILABILITY; |
579 std::unique_ptr<Animation> to_add( | 580 std::unique_ptr<Animation> to_add( |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 if (animation_host()) { | 1352 if (animation_host()) { |
1352 DCHECK(animation_host()->mutator_host_client()); | 1353 DCHECK(animation_host()->mutator_host_client()); |
1353 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( | 1354 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
1354 element_id()); | 1355 element_id()); |
1355 } | 1356 } |
1356 | 1357 |
1357 return gfx::ScrollOffset(); | 1358 return gfx::ScrollOffset(); |
1358 } | 1359 } |
1359 | 1360 |
1360 } // namespace cc | 1361 } // namespace cc |
OLD | NEW |