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

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

Issue 1887593003: CC Animation: Make layer_animation_controller a private member of ElementAnimations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | cc/animation/animation_player.cc » ('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_host.h" 5 #include "cc/animation/animation_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const gfx::Vector2dF& scroll_delta, 72 const gfx::Vector2dF& scroll_delta,
73 const gfx::ScrollOffset& max_scroll_offset, 73 const gfx::ScrollOffset& max_scroll_offset,
74 base::TimeTicks frame_monotonic_time) { 74 base::TimeTicks frame_monotonic_time) {
75 DCHECK(scroll_offset_animation_player_); 75 DCHECK(scroll_offset_animation_player_);
76 if (!scroll_offset_animation_player_->element_animations()) 76 if (!scroll_offset_animation_player_->element_animations())
77 return false; 77 return false;
78 78
79 DCHECK_EQ(layer_id, scroll_offset_animation_player_->layer_id()); 79 DCHECK_EQ(layer_id, scroll_offset_animation_player_->layer_id());
80 80
81 Animation* animation = scroll_offset_animation_player_->element_animations() 81 Animation* animation = scroll_offset_animation_player_->element_animations()
82 ->layer_animation_controller()
83 ->GetAnimation(TargetProperty::SCROLL_OFFSET); 82 ->GetAnimation(TargetProperty::SCROLL_OFFSET);
84 if (!animation) { 83 if (!animation) {
85 scroll_offset_animation_player_->DetachLayer(); 84 scroll_offset_animation_player_->DetachLayer();
86 return false; 85 return false;
87 } 86 }
88 87
89 ScrollOffsetAnimationCurve* curve = 88 ScrollOffsetAnimationCurve* curve =
90 animation->curve()->ToScrollOffsetAnimationCurve(); 89 animation->curve()->ToScrollOffsetAnimationCurve();
91 90
92 gfx::ScrollOffset new_target = 91 gfx::ScrollOffset new_target =
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 329 }
331 } 330 }
332 331
333 LayerAnimationController* AnimationHost::GetControllerForLayerId( 332 LayerAnimationController* AnimationHost::GetControllerForLayerId(
334 int layer_id) const { 333 int layer_id) const {
335 const ElementAnimations* element_animations = 334 const ElementAnimations* element_animations =
336 GetElementAnimationsForLayerId(layer_id); 335 GetElementAnimationsForLayerId(layer_id);
337 if (!element_animations) 336 if (!element_animations)
338 return nullptr; 337 return nullptr;
339 338
340 return element_animations->layer_animation_controller(); 339 return element_animations->layer_animation_controller_.get();
341 } 340 }
342 341
343 ElementAnimations* AnimationHost::GetElementAnimationsForLayerId( 342 ElementAnimations* AnimationHost::GetElementAnimationsForLayerId(
344 int layer_id) const { 343 int layer_id) const {
345 DCHECK(layer_id); 344 DCHECK(layer_id);
346 auto iter = layer_to_element_animations_map_.find(layer_id); 345 auto iter = layer_to_element_animations_map_.find(layer_id);
347 return iter == layer_to_element_animations_map_.end() ? nullptr 346 return iter == layer_to_element_animations_map_.end() ? nullptr
348 : iter->second.get(); 347 : iter->second.get();
349 } 348 }
350 349
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 AnimationHost::active_animation_controllers_for_testing() const { 707 AnimationHost::active_animation_controllers_for_testing() const {
709 return active_animation_controllers_; 708 return active_animation_controllers_;
710 } 709 }
711 710
712 const AnimationHost::AnimationControllerMap& 711 const AnimationHost::AnimationControllerMap&
713 AnimationHost::all_animation_controllers_for_testing() const { 712 AnimationHost::all_animation_controllers_for_testing() const {
714 return all_animation_controllers_; 713 return all_animation_controllers_;
715 } 714 }
716 715
717 } // namespace cc 716 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/animation_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698