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

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

Issue 1734063003: Share animations from compositor to main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win trybot failure Created 4 years, 9 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
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/layer_animation_controller.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/element_animations.h" 5 #include "cc/animation/element_animations.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "cc/animation/animation_host.h" 8 #include "cc/animation/animation_host.h"
9 #include "cc/animation/animation_player.h" 9 #include "cc/animation/animation_player.h"
10 #include "cc/animation/animation_registrar.h" 10 #include "cc/animation/animation_registrar.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 base::TimeTicks monotonic_time, 263 base::TimeTicks monotonic_time,
264 TargetProperty::Type target_property, 264 TargetProperty::Type target_property,
265 int group) { 265 int group) {
266 for (PlayersListNode* node = players_list_->head(); 266 for (PlayersListNode* node = players_list_->head();
267 node != players_list_->end(); node = node->next()) { 267 node != players_list_->end(); node = node->next()) {
268 AnimationPlayer* player = node->value(); 268 AnimationPlayer* player = node->value();
269 player->NotifyAnimationAborted(monotonic_time, target_property, group); 269 player->NotifyAnimationAborted(monotonic_time, target_property, group);
270 } 270 }
271 } 271 }
272 272
273 void ElementAnimations::NotifyAnimationTakeover(
274 base::TimeTicks monotonic_time,
275 TargetProperty::Type target_property,
276 double animation_start_time,
277 scoped_ptr<AnimationCurve> curve) {
278 DCHECK(curve);
279 for (PlayersListNode* node = players_list_->head();
280 node != players_list_->end(); node = node->next()) {
281 scoped_ptr<AnimationCurve> animation_curve = curve->Clone();
282 AnimationPlayer* player = node->value();
283 player->NotifyAnimationTakeover(monotonic_time, target_property,
284 animation_start_time,
285 std::move(animation_curve));
286 }
287 }
288
273 gfx::ScrollOffset ElementAnimations::ScrollOffsetForAnimation() const { 289 gfx::ScrollOffset ElementAnimations::ScrollOffsetForAnimation() const {
274 DCHECK(layer_animation_controller_); 290 DCHECK(layer_animation_controller_);
275 if (animation_host()) { 291 if (animation_host()) {
276 DCHECK(animation_host()->mutator_host_client()); 292 DCHECK(animation_host()->mutator_host_client());
277 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( 293 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation(
278 layer_id()); 294 layer_id());
279 } 295 }
280 296
281 return gfx::ScrollOffset(); 297 return gfx::ScrollOffset();
282 } 298 }
283 299
284 } // namespace cc 300 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/layer_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698