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

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

Issue 1548883002: Revert of Run smooth scroll animations on the compositor when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/blink/web_compositor_animation_player_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/animation_player.h" 5 #include "cc/animation/animation_player.h"
6 6
7 #include "cc/animation/animation_delegate.h" 7 #include "cc/animation/animation_delegate.h"
8 #include "cc/animation/animation_host.h" 8 #include "cc/animation/animation_host.h"
9 #include "cc/animation/animation_timeline.h" 9 #include "cc/animation/animation_timeline.h"
10 #include "cc/animation/element_animations.h" 10 #include "cc/animation/element_animations.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } else { 146 } else {
147 auto animations_to_remove = 147 auto animations_to_remove =
148 std::remove_if(animations_.begin(), animations_.end(), 148 std::remove_if(animations_.begin(), animations_.end(),
149 [animation_id](const scoped_ptr<Animation>& animation) { 149 [animation_id](const scoped_ptr<Animation>& animation) {
150 return animation->id() == animation_id; 150 return animation->id() == animation_id;
151 }); 151 });
152 animations_.erase(animations_to_remove, animations_.end()); 152 animations_.erase(animations_to_remove, animations_.end());
153 } 153 }
154 } 154 }
155 155
156 void AnimationPlayer::AbortAnimation(int animation_id) {
157 DCHECK(element_animations_);
158 element_animations_->layer_animation_controller()->AbortAnimation(
159 animation_id);
160 SetNeedsCommit();
161 }
162
163 void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) { 156 void AnimationPlayer::PushPropertiesTo(AnimationPlayer* player_impl) {
164 if (!element_animations_) { 157 if (!element_animations_) {
165 if (player_impl->element_animations()) 158 if (player_impl->element_animations())
166 player_impl->DetachLayer(); 159 player_impl->DetachLayer();
167 return; 160 return;
168 } 161 }
169 162
170 DCHECK(layer_id_); 163 DCHECK(layer_id_);
171 if (!player_impl->element_animations()) 164 if (!player_impl->element_animations())
172 player_impl->AttachLayer(layer_id_); 165 player_impl->AttachLayer(layer_id_);
(...skipping 17 matching lines...) Expand all
190 target_property, group); 183 target_property, group);
191 } 184 }
192 185
193 void AnimationPlayer::SetNeedsCommit() { 186 void AnimationPlayer::SetNeedsCommit() {
194 DCHECK(animation_host_); 187 DCHECK(animation_host_);
195 animation_host_->SetNeedsCommit(); 188 animation_host_->SetNeedsCommit();
196 animation_host_->SetNeedsRebuildPropertyTrees(); 189 animation_host_->SetNeedsRebuildPropertyTrees();
197 } 190 }
198 191
199 } // namespace cc 192 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/blink/web_compositor_animation_player_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698