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

Side by Side Diff: cc/animation/element_animations.cc

Issue 2346583002: cc : Fix the bug in tracking currently running animations for an element (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 ElementAnimations::PlayersList::Iterator it(players_list_.get()); 628 ElementAnimations::PlayersList::Iterator it(players_list_.get());
629 AnimationPlayer* player; 629 AnimationPlayer* player;
630 while ((player = it.GetNext()) != nullptr) { 630 while ((player = it.GetNext()) != nullptr) {
631 for (const auto& animation : player->animations()) { 631 for (const auto& animation : player->animations()) {
632 if (!animation->is_finished() && 632 if (!animation->is_finished() &&
633 animation->target_property() == property) { 633 animation->target_property() == property) {
634 animation_state->potentially_animating_for_active_elements |= 634 animation_state->potentially_animating_for_active_elements |=
635 animation->affects_active_elements(); 635 animation->affects_active_elements();
636 animation_state->potentially_animating_for_pending_elements |= 636 animation_state->potentially_animating_for_pending_elements |=
637 animation->affects_pending_elements(); 637 animation->affects_pending_elements();
638 animation_state->currently_running_for_active_elements = 638 animation_state->currently_running_for_active_elements |=
639 animation_state->potentially_animating_for_active_elements && 639 animation->affects_active_elements() &&
640 animation->InEffect(last_tick_time_); 640 animation->InEffect(last_tick_time_);
641 animation_state->currently_running_for_pending_elements = 641 animation_state->currently_running_for_pending_elements |=
642 animation_state->potentially_animating_for_pending_elements && 642 animation->affects_pending_elements() &&
643 animation->InEffect(last_tick_time_); 643 animation->InEffect(last_tick_time_);
loyso (OOO) 2016/09/14 23:49:08 NIT: Would be nice to add a DCHECK as a loop invar
644 } 644 }
645 } 645 }
646 } 646 }
647 647
648 bool potentially_animating_changed_for_active_elements = 648 bool potentially_animating_changed_for_active_elements =
649 was_potentially_animating_for_active_elements != 649 was_potentially_animating_for_active_elements !=
650 animation_state->potentially_animating_for_active_elements; 650 animation_state->potentially_animating_for_active_elements;
651 bool potentially_animating_changed_for_pending_elements = 651 bool potentially_animating_changed_for_pending_elements =
652 was_potentially_animating_for_pending_elements != 652 was_potentially_animating_for_pending_elements !=
653 animation_state->potentially_animating_for_pending_elements; 653 animation_state->potentially_animating_for_pending_elements;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 if (animation_host()) { 863 if (animation_host()) {
864 DCHECK(animation_host()->mutator_host_client()); 864 DCHECK(animation_host()->mutator_host_client());
865 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( 865 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation(
866 element_id()); 866 element_id());
867 } 867 }
868 868
869 return gfx::ScrollOffset(); 869 return gfx::ScrollOffset();
870 } 870 }
871 871
872 } // namespace cc 872 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/element_animations_unittest.cc » ('j') | cc/animation/element_animations_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698