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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 !animations_[i] | 521 !animations_[i] |
522 ->curve() | 522 ->curve() |
523 ->ToScrollOffsetAnimationCurve() | 523 ->ToScrollOffsetAnimationCurve() |
524 ->HasSetInitialValue()) { | 524 ->HasSetInitialValue()) { |
525 gfx::ScrollOffset current_scroll_offset; | 525 gfx::ScrollOffset current_scroll_offset; |
526 if (element_animations_impl->has_element_in_active_list()) { | 526 if (element_animations_impl->has_element_in_active_list()) { |
527 current_scroll_offset = | 527 current_scroll_offset = |
528 element_animations_impl->ScrollOffsetForAnimation(); | 528 element_animations_impl->ScrollOffsetForAnimation(); |
529 } else { | 529 } else { |
530 // The owning layer isn't yet in the active tree, so the main thread | 530 // The owning layer isn't yet in the active tree, so the main thread |
531 // scroll offset will be up-to-date. | 531 // scroll offset will be up to date. |
532 current_scroll_offset = ScrollOffsetForAnimation(); | 532 current_scroll_offset = ScrollOffsetForAnimation(); |
533 } | 533 } |
534 animations_[i]->curve()->ToScrollOffsetAnimationCurve()->SetInitialValue( | 534 animations_[i]->curve()->ToScrollOffsetAnimationCurve()->SetInitialValue( |
535 current_scroll_offset); | 535 current_scroll_offset); |
536 } | 536 } |
537 | 537 |
538 // The new animation should be set to run as soon as possible. | 538 // The new animation should be set to run as soon as possible. |
539 Animation::RunState initial_run_state = | 539 Animation::RunState initial_run_state = |
540 Animation::WAITING_FOR_TARGET_AVAILABILITY; | 540 Animation::WAITING_FOR_TARGET_AVAILABILITY; |
541 std::unique_ptr<Animation> to_add( | 541 std::unique_ptr<Animation> to_add( |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 if (animation_host()) { | 1436 if (animation_host()) { |
1437 DCHECK(animation_host()->mutator_host_client()); | 1437 DCHECK(animation_host()->mutator_host_client()); |
1438 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( | 1438 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
1439 element_id()); | 1439 element_id()); |
1440 } | 1440 } |
1441 | 1441 |
1442 return gfx::ScrollOffset(); | 1442 return gfx::ScrollOffset(); |
1443 } | 1443 } |
1444 | 1444 |
1445 } // namespace cc | 1445 } // namespace cc |
OLD | NEW |