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

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

Issue 1922833002: CC Animation: Start replacing int layer_id with ElementId element_id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/element_animations_unittest.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/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 10 matching lines...) Expand all
21 21
22 namespace cc { 22 namespace cc {
23 23
24 scoped_refptr<ElementAnimations> ElementAnimations::Create() { 24 scoped_refptr<ElementAnimations> ElementAnimations::Create() {
25 return make_scoped_refptr(new ElementAnimations()); 25 return make_scoped_refptr(new ElementAnimations());
26 } 26 }
27 27
28 ElementAnimations::ElementAnimations() 28 ElementAnimations::ElementAnimations()
29 : players_list_(new PlayersList()), 29 : players_list_(new PlayersList()),
30 animation_host_(), 30 animation_host_(),
31 layer_id_(), 31 element_id_(),
32 is_active_(false), 32 is_active_(false),
33 has_element_in_active_list_(false), 33 has_element_in_active_list_(false),
34 has_element_in_pending_list_(false), 34 has_element_in_pending_list_(false),
35 needs_to_start_animations_(false), 35 needs_to_start_animations_(false),
36 scroll_offset_animation_was_interrupted_(false), 36 scroll_offset_animation_was_interrupted_(false),
37 potentially_animating_transform_for_active_elements_(false), 37 potentially_animating_transform_for_active_elements_(false),
38 potentially_animating_transform_for_pending_elements_(false) {} 38 potentially_animating_transform_for_pending_elements_(false) {}
39 39
40 ElementAnimations::~ElementAnimations() {} 40 ElementAnimations::~ElementAnimations() {}
41 41
42 void ElementAnimations::SetAnimationHost(AnimationHost* host) { 42 void ElementAnimations::SetAnimationHost(AnimationHost* host) {
43 animation_host_ = host; 43 animation_host_ = host;
44 } 44 }
45 45
46 void ElementAnimations::SetLayerId(int layer_id) { 46 void ElementAnimations::SetElementId(ElementId element_id) {
47 layer_id_ = layer_id; 47 element_id_ = element_id;
48 } 48 }
49 49
50 void ElementAnimations::InitAffectedElementTypes() { 50 void ElementAnimations::InitAffectedElementTypes() {
51 DCHECK(layer_id_); 51 DCHECK(element_id_);
52 DCHECK(animation_host_); 52 DCHECK(animation_host_);
53 53
54 UpdateActivation(FORCE_ACTIVATION); 54 UpdateActivation(FORCE_ACTIVATION);
55 55
56 DCHECK(animation_host_->mutator_host_client()); 56 DCHECK(animation_host_->mutator_host_client());
57 if (animation_host_->mutator_host_client()->IsLayerInTree( 57 if (animation_host_->mutator_host_client()->IsLayerInTree(
58 layer_id_, LayerTreeType::ACTIVE)) { 58 element_id_, LayerTreeType::ACTIVE)) {
59 set_has_element_in_active_list(true); 59 set_has_element_in_active_list(true);
60 } 60 }
61 if (animation_host_->mutator_host_client()->IsLayerInTree( 61 if (animation_host_->mutator_host_client()->IsLayerInTree(
62 layer_id_, LayerTreeType::PENDING)) { 62 element_id_, LayerTreeType::PENDING)) {
63 set_has_element_in_pending_list(true); 63 set_has_element_in_pending_list(true);
64 } 64 }
65 } 65 }
66 66
67 void ElementAnimations::ClearAffectedElementTypes() { 67 void ElementAnimations::ClearAffectedElementTypes() {
68 DCHECK(animation_host_); 68 DCHECK(animation_host_);
69 69
70 if (has_element_in_active_list()) 70 if (has_element_in_active_list())
71 OnTransformIsPotentiallyAnimatingChanged(LayerTreeType::ACTIVE, false); 71 OnTransformIsPotentiallyAnimatingChanged(LayerTreeType::ACTIVE, false);
72 set_has_element_in_active_list(false); 72 set_has_element_in_active_list(false);
73 73
74 if (has_element_in_pending_list()) 74 if (has_element_in_pending_list())
75 OnTransformIsPotentiallyAnimatingChanged(LayerTreeType::PENDING, false); 75 OnTransformIsPotentiallyAnimatingChanged(LayerTreeType::PENDING, false);
76 set_has_element_in_pending_list(false); 76 set_has_element_in_pending_list(false);
77 77
78 animation_host_->DidDeactivateElementAnimations(this); 78 animation_host_->DidDeactivateElementAnimations(this);
79 UpdateActivation(FORCE_ACTIVATION); 79 UpdateActivation(FORCE_ACTIVATION);
80 } 80 }
81 81
82 void ElementAnimations::LayerRegistered(int layer_id, LayerTreeType tree_type) { 82 void ElementAnimations::LayerRegistered(ElementId element_id,
83 DCHECK_EQ(layer_id_, layer_id); 83 LayerTreeType tree_type) {
84 DCHECK_EQ(element_id_, element_id);
84 85
85 if (tree_type == LayerTreeType::ACTIVE) 86 if (tree_type == LayerTreeType::ACTIVE)
86 set_has_element_in_active_list(true); 87 set_has_element_in_active_list(true);
87 else 88 else
88 set_has_element_in_pending_list(true); 89 set_has_element_in_pending_list(true);
89 } 90 }
90 91
91 void ElementAnimations::LayerUnregistered(int layer_id, 92 void ElementAnimations::LayerUnregistered(ElementId element_id,
92 LayerTreeType tree_type) { 93 LayerTreeType tree_type) {
93 DCHECK_EQ(this->layer_id(), layer_id); 94 DCHECK_EQ(this->element_id(), element_id);
94 if (tree_type == LayerTreeType::ACTIVE) 95 if (tree_type == LayerTreeType::ACTIVE)
95 set_has_element_in_active_list(false); 96 set_has_element_in_active_list(false);
96 else 97 else
97 set_has_element_in_pending_list(false); 98 set_has_element_in_pending_list(false);
98 } 99 }
99 100
100 void ElementAnimations::AddPlayer(AnimationPlayer* player) { 101 void ElementAnimations::AddPlayer(AnimationPlayer* player) {
101 players_list_->Append(player); 102 players_list_->Append(player);
102 } 103 }
103 104
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (!animation->is_impl_only()) 167 if (!animation->is_impl_only())
167 continue; 168 continue;
168 169
169 if (!animation->InEffect(monotonic_time)) 170 if (!animation->InEffect(monotonic_time))
170 continue; 171 continue;
171 172
172 base::TimeDelta trimmed = 173 base::TimeDelta trimmed =
173 animation->TrimTimeToCurrentIteration(monotonic_time); 174 animation->TrimTimeToCurrentIteration(monotonic_time);
174 switch (animation->target_property()) { 175 switch (animation->target_property()) {
175 case TargetProperty::OPACITY: { 176 case TargetProperty::OPACITY: {
176 AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, layer_id_, 177 AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, element_id_,
177 animation->group(), TargetProperty::OPACITY, 178 animation->group(), TargetProperty::OPACITY,
178 monotonic_time); 179 monotonic_time);
179 const FloatAnimationCurve* float_animation_curve = 180 const FloatAnimationCurve* float_animation_curve =
180 animation->curve()->ToFloatAnimationCurve(); 181 animation->curve()->ToFloatAnimationCurve();
181 event.opacity = float_animation_curve->GetValue(trimmed); 182 event.opacity = float_animation_curve->GetValue(trimmed);
182 event.is_impl_only = true; 183 event.is_impl_only = true;
183 events->events_.push_back(event); 184 events->events_.push_back(event);
184 break; 185 break;
185 } 186 }
186 187
187 case TargetProperty::TRANSFORM: { 188 case TargetProperty::TRANSFORM: {
188 AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, layer_id_, 189 AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, element_id_,
189 animation->group(), TargetProperty::TRANSFORM, 190 animation->group(), TargetProperty::TRANSFORM,
190 monotonic_time); 191 monotonic_time);
191 const TransformAnimationCurve* transform_animation_curve = 192 const TransformAnimationCurve* transform_animation_curve =
192 animation->curve()->ToTransformAnimationCurve(); 193 animation->curve()->ToTransformAnimationCurve();
193 event.transform = transform_animation_curve->GetValue(trimmed); 194 event.transform = transform_animation_curve->GetValue(trimmed);
194 event.is_impl_only = true; 195 event.is_impl_only = true;
195 events->events_.push_back(event); 196 events->events_.push_back(event);
196 break; 197 break;
197 } 198 }
198 199
199 case TargetProperty::FILTER: { 200 case TargetProperty::FILTER: {
200 AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, layer_id_, 201 AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, element_id_,
201 animation->group(), TargetProperty::FILTER, 202 animation->group(), TargetProperty::FILTER,
202 monotonic_time); 203 monotonic_time);
203 const FilterAnimationCurve* filter_animation_curve = 204 const FilterAnimationCurve* filter_animation_curve =
204 animation->curve()->ToFilterAnimationCurve(); 205 animation->curve()->ToFilterAnimationCurve();
205 event.filters = filter_animation_curve->GetValue(trimmed); 206 event.filters = filter_animation_curve->GetValue(trimmed);
206 event.is_impl_only = true; 207 event.is_impl_only = true;
207 events->events_.push_back(event); 208 events->events_.push_back(event);
208 break; 209 break;
209 } 210 }
210 211
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 if (!animations_[i]->has_set_start_time() && 742 if (!animations_[i]->has_set_start_time() &&
742 !animations_[i]->needs_synchronized_start_time()) 743 !animations_[i]->needs_synchronized_start_time())
743 animations_[i]->set_start_time(monotonic_time); 744 animations_[i]->set_start_time(monotonic_time);
744 if (events) { 745 if (events) {
745 base::TimeTicks start_time; 746 base::TimeTicks start_time;
746 if (animations_[i]->has_set_start_time()) 747 if (animations_[i]->has_set_start_time())
747 start_time = animations_[i]->start_time(); 748 start_time = animations_[i]->start_time();
748 else 749 else
749 start_time = monotonic_time; 750 start_time = monotonic_time;
750 AnimationEvent started_event( 751 AnimationEvent started_event(
751 AnimationEvent::STARTED, layer_id_, animations_[i]->group(), 752 AnimationEvent::STARTED, element_id_, animations_[i]->group(),
752 animations_[i]->target_property(), start_time); 753 animations_[i]->target_property(), start_time);
753 started_event.is_impl_only = animations_[i]->is_impl_only(); 754 started_event.is_impl_only = animations_[i]->is_impl_only();
754 if (started_event.is_impl_only) 755 if (started_event.is_impl_only)
755 NotifyAnimationStarted(started_event); 756 NotifyAnimationStarted(started_event);
756 else 757 else
757 events->events_.push_back(started_event); 758 events->events_.push_back(started_event);
758 } 759 }
759 } 760 }
760 } 761 }
761 } 762 }
(...skipping 22 matching lines...) Expand all
784 animations_with_same_group_id.reserve(animations_.size()); 785 animations_with_same_group_id.reserve(animations_.size());
785 // Non-aborted animations are marked for deletion after a corresponding 786 // Non-aborted animations are marked for deletion after a corresponding
786 // AnimationEvent::FINISHED event is sent or received. This means that if 787 // AnimationEvent::FINISHED event is sent or received. This means that if
787 // we don't have an events vector, we must ensure that non-aborted animations 788 // we don't have an events vector, we must ensure that non-aborted animations
788 // have received a finished event before marking them for deletion. 789 // have received a finished event before marking them for deletion.
789 for (size_t i = 0; i < animations_.size(); i++) { 790 for (size_t i = 0; i < animations_.size(); i++) {
790 int group_id = animations_[i]->group(); 791 int group_id = animations_[i]->group();
791 if (animations_[i]->run_state() == Animation::ABORTED) { 792 if (animations_[i]->run_state() == Animation::ABORTED) {
792 if (events && !animations_[i]->is_impl_only()) { 793 if (events && !animations_[i]->is_impl_only()) {
793 AnimationEvent aborted_event( 794 AnimationEvent aborted_event(
794 AnimationEvent::ABORTED, layer_id_, group_id, 795 AnimationEvent::ABORTED, element_id_, group_id,
795 animations_[i]->target_property(), monotonic_time); 796 animations_[i]->target_property(), monotonic_time);
796 events->events_.push_back(aborted_event); 797 events->events_.push_back(aborted_event);
797 } 798 }
798 // If on the compositor or on the main thread and received finish event, 799 // If on the compositor or on the main thread and received finish event,
799 // animation can be marked for deletion. 800 // animation can be marked for deletion.
800 if (events || animations_[i]->received_finished_event()) { 801 if (events || animations_[i]->received_finished_event()) {
801 animations_[i]->SetRunState(Animation::WAITING_FOR_DELETION, 802 animations_[i]->SetRunState(Animation::WAITING_FOR_DELETION,
802 monotonic_time); 803 monotonic_time);
803 marked_animations_for_deletions = true; 804 marked_animations_for_deletions = true;
804 } 805 }
805 continue; 806 continue;
806 } 807 }
807 808
808 // If running on the compositor and need to complete an aborted animation 809 // If running on the compositor and need to complete an aborted animation
809 // on the main thread. 810 // on the main thread.
810 if (events && 811 if (events &&
811 animations_[i]->run_state() == 812 animations_[i]->run_state() ==
812 Animation::ABORTED_BUT_NEEDS_COMPLETION) { 813 Animation::ABORTED_BUT_NEEDS_COMPLETION) {
813 AnimationEvent aborted_event(AnimationEvent::TAKEOVER, layer_id_, 814 AnimationEvent aborted_event(AnimationEvent::TAKEOVER, element_id_,
814 group_id, animations_[i]->target_property(), 815 group_id, animations_[i]->target_property(),
815 monotonic_time); 816 monotonic_time);
816 aborted_event.animation_start_time = 817 aborted_event.animation_start_time =
817 (animations_[i]->start_time() - base::TimeTicks()).InSecondsF(); 818 (animations_[i]->start_time() - base::TimeTicks()).InSecondsF();
818 const ScrollOffsetAnimationCurve* scroll_offset_animation_curve = 819 const ScrollOffsetAnimationCurve* scroll_offset_animation_curve =
819 animations_[i]->curve()->ToScrollOffsetAnimationCurve(); 820 animations_[i]->curve()->ToScrollOffsetAnimationCurve();
820 aborted_event.curve = scroll_offset_animation_curve->Clone(); 821 aborted_event.curve = scroll_offset_animation_curve->Clone();
821 // Notify the compositor that the animation is finished. 822 // Notify the compositor that the animation is finished.
822 NotifyPlayersAnimationFinished(aborted_event.monotonic_time, 823 NotifyPlayersAnimationFinished(aborted_event.monotonic_time,
823 aborted_event.target_property, 824 aborted_event.target_property,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 } 875 }
875 } 876 }
876 if (all_anims_with_same_id_are_finished) { 877 if (all_anims_with_same_id_are_finished) {
877 // We now need to remove all animations with the same group id as 878 // We now need to remove all animations with the same group id as
878 // group_id (and send along animation finished notifications, if 879 // group_id (and send along animation finished notifications, if
879 // necessary). 880 // necessary).
880 for (size_t j = 0; j < animations_with_same_group_id.size(); j++) { 881 for (size_t j = 0; j < animations_with_same_group_id.size(); j++) {
881 size_t animation_index = animations_with_same_group_id[j]; 882 size_t animation_index = animations_with_same_group_id[j];
882 if (events) { 883 if (events) {
883 AnimationEvent finished_event( 884 AnimationEvent finished_event(
884 AnimationEvent::FINISHED, layer_id_, 885 AnimationEvent::FINISHED, element_id_,
885 animations_[animation_index]->group(), 886 animations_[animation_index]->group(),
886 animations_[animation_index]->target_property(), monotonic_time); 887 animations_[animation_index]->target_property(), monotonic_time);
887 finished_event.is_impl_only = 888 finished_event.is_impl_only =
888 animations_[animation_index]->is_impl_only(); 889 animations_[animation_index]->is_impl_only();
889 if (finished_event.is_impl_only) 890 if (finished_event.is_impl_only)
890 NotifyAnimationFinished(finished_event); 891 NotifyAnimationFinished(finished_event);
891 else 892 else
892 events->events_.push_back(finished_event); 893 events->events_.push_back(finished_event);
893 } 894 }
894 animations_[animation_index]->SetRunState( 895 animations_[animation_index]->SetRunState(
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1237
1237 Animation* ElementAnimations::GetAnimationById(int animation_id) const { 1238 Animation* ElementAnimations::GetAnimationById(int animation_id) const {
1238 for (size_t i = 0; i < animations_.size(); ++i) 1239 for (size_t i = 0; i < animations_.size(); ++i)
1239 if (animations_[i]->id() == animation_id) 1240 if (animations_[i]->id() == animation_id)
1240 return animations_[i].get(); 1241 return animations_[i].get();
1241 return nullptr; 1242 return nullptr;
1242 } 1243 }
1243 1244
1244 void ElementAnimations::OnFilterAnimated(LayerTreeType tree_type, 1245 void ElementAnimations::OnFilterAnimated(LayerTreeType tree_type,
1245 const FilterOperations& filters) { 1246 const FilterOperations& filters) {
1246 DCHECK(layer_id()); 1247 DCHECK(element_id());
1247 DCHECK(animation_host()); 1248 DCHECK(animation_host());
1248 DCHECK(animation_host()->mutator_host_client()); 1249 DCHECK(animation_host()->mutator_host_client());
1249 animation_host()->mutator_host_client()->SetLayerFilterMutated( 1250 animation_host()->mutator_host_client()->SetLayerFilterMutated(
1250 layer_id(), tree_type, filters); 1251 element_id(), tree_type, filters);
1251 } 1252 }
1252 1253
1253 void ElementAnimations::OnOpacityAnimated(LayerTreeType tree_type, 1254 void ElementAnimations::OnOpacityAnimated(LayerTreeType tree_type,
1254 float opacity) { 1255 float opacity) {
1255 DCHECK(layer_id()); 1256 DCHECK(element_id());
1256 DCHECK(animation_host()); 1257 DCHECK(animation_host());
1257 DCHECK(animation_host()->mutator_host_client()); 1258 DCHECK(animation_host()->mutator_host_client());
1258 animation_host()->mutator_host_client()->SetLayerOpacityMutated( 1259 animation_host()->mutator_host_client()->SetLayerOpacityMutated(
1259 layer_id(), tree_type, opacity); 1260 element_id(), tree_type, opacity);
1260 } 1261 }
1261 1262
1262 void ElementAnimations::OnTransformAnimated(LayerTreeType tree_type, 1263 void ElementAnimations::OnTransformAnimated(LayerTreeType tree_type,
1263 const gfx::Transform& transform) { 1264 const gfx::Transform& transform) {
1264 DCHECK(layer_id()); 1265 DCHECK(element_id());
1265 DCHECK(animation_host()); 1266 DCHECK(animation_host());
1266 DCHECK(animation_host()->mutator_host_client()); 1267 DCHECK(animation_host()->mutator_host_client());
1267 animation_host()->mutator_host_client()->SetLayerTransformMutated( 1268 animation_host()->mutator_host_client()->SetLayerTransformMutated(
1268 layer_id(), tree_type, transform); 1269 element_id(), tree_type, transform);
1269 } 1270 }
1270 1271
1271 void ElementAnimations::OnScrollOffsetAnimated( 1272 void ElementAnimations::OnScrollOffsetAnimated(
1272 LayerTreeType tree_type, 1273 LayerTreeType tree_type,
1273 const gfx::ScrollOffset& scroll_offset) { 1274 const gfx::ScrollOffset& scroll_offset) {
1274 DCHECK(layer_id()); 1275 DCHECK(element_id());
1275 DCHECK(animation_host()); 1276 DCHECK(animation_host());
1276 DCHECK(animation_host()->mutator_host_client()); 1277 DCHECK(animation_host()->mutator_host_client());
1277 animation_host()->mutator_host_client()->SetLayerScrollOffsetMutated( 1278 animation_host()->mutator_host_client()->SetLayerScrollOffsetMutated(
1278 layer_id(), tree_type, scroll_offset); 1279 element_id(), tree_type, scroll_offset);
1279 } 1280 }
1280 1281
1281 void ElementAnimations::OnAnimationWaitingForDeletion() { 1282 void ElementAnimations::OnAnimationWaitingForDeletion() {
1282 // TODO(loyso): Invalidate AnimationHost::SetNeedsPushProperties here. 1283 // TODO(loyso): Invalidate AnimationHost::SetNeedsPushProperties here.
1283 // But we always do PushProperties in AnimationHost for now. crbug.com/604280 1284 // But we always do PushProperties in AnimationHost for now. crbug.com/604280
1284 DCHECK(animation_host()); 1285 DCHECK(animation_host());
1285 animation_host()->OnAnimationWaitingForDeletion(); 1286 animation_host()->OnAnimationWaitingForDeletion();
1286 } 1287 }
1287 1288
1288 void ElementAnimations::OnTransformIsPotentiallyAnimatingChanged( 1289 void ElementAnimations::OnTransformIsPotentiallyAnimatingChanged(
1289 LayerTreeType tree_type, 1290 LayerTreeType tree_type,
1290 bool is_animating) { 1291 bool is_animating) {
1291 DCHECK(layer_id()); 1292 DCHECK(element_id());
1292 DCHECK(animation_host()); 1293 DCHECK(animation_host());
1293 DCHECK(animation_host()->mutator_host_client()); 1294 DCHECK(animation_host()->mutator_host_client());
1294 animation_host() 1295 animation_host()
1295 ->mutator_host_client() 1296 ->mutator_host_client()
1296 ->LayerTransformIsPotentiallyAnimatingChanged(layer_id(), tree_type, 1297 ->LayerTransformIsPotentiallyAnimatingChanged(element_id(), tree_type,
1297 is_animating); 1298 is_animating);
1298 } 1299 }
1299 1300
1300 void ElementAnimations::NotifyPlayersAnimationStarted( 1301 void ElementAnimations::NotifyPlayersAnimationStarted(
1301 base::TimeTicks monotonic_time, 1302 base::TimeTicks monotonic_time,
1302 TargetProperty::Type target_property, 1303 TargetProperty::Type target_property,
1303 int group) { 1304 int group) {
1304 for (PlayersListNode* node = players_list_->head(); 1305 for (PlayersListNode* node = players_list_->head();
1305 node != players_list_->end(); node = node->next()) { 1306 node != players_list_->end(); node = node->next()) {
1306 AnimationPlayer* player = node->value(); 1307 AnimationPlayer* player = node->value();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 player->NotifyAnimationTakeover(monotonic_time, target_property, 1344 player->NotifyAnimationTakeover(monotonic_time, target_property,
1344 animation_start_time, 1345 animation_start_time,
1345 std::move(animation_curve)); 1346 std::move(animation_curve));
1346 } 1347 }
1347 } 1348 }
1348 1349
1349 gfx::ScrollOffset ElementAnimations::ScrollOffsetForAnimation() const { 1350 gfx::ScrollOffset ElementAnimations::ScrollOffsetForAnimation() const {
1350 if (animation_host()) { 1351 if (animation_host()) {
1351 DCHECK(animation_host()->mutator_host_client()); 1352 DCHECK(animation_host()->mutator_host_client());
1352 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( 1353 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation(
1353 layer_id()); 1354 element_id());
1354 } 1355 }
1355 1356
1356 return gfx::ScrollOffset(); 1357 return gfx::ScrollOffset();
1357 } 1358 }
1358 1359
1359 } // namespace cc 1360 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698