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

Unified Diff: ui/compositor/layer_animator.cc

Issue 1973083002: Use element id's for animations (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 side-by-side diff with in-line comments
Download patch
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index b3474964bcfeb46668c57344a8926907631d27b6..d35b7f6036fb31973efe52d981158df06fa4108a 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -156,8 +156,8 @@ void LayerAnimator::SetCompositor(Compositor* compositor) {
// AnimationHost::RegisterPlayerForLayer via
// AnimationHost::GetElementAnimationsForLayerId.
if (element_animations_state_) {
- DCHECK_EQ(element_animations_state_->element_id(),
- delegate_->GetCcLayer()->id());
+ DCHECK_EQ(element_animations_state_->element_id().value,
+ static_cast<uint64_t>(delegate_->GetCcLayer()->id()));
timeline->animation_host()->RegisterElementAnimations(
element_animations_state_.get());
}
@@ -176,13 +176,14 @@ void LayerAnimator::ResetCompositor(Compositor* compositor) {
cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline();
DCHECK(timeline);
- const int layer_id = animation_player_->element_id();
+ cc::ElementId element_id(animation_player_->element_id());
// Store a reference to ElementAnimations (if any)
// so it may be picked up in LayerAnimator::SetCompositor.
- if (layer_id) {
+ if (element_id) {
element_animations_state_ =
- timeline->animation_host()->GetElementAnimationsForElementId(layer_id);
+ timeline->animation_host()->GetElementAnimationsForElementId(
+ element_id);
}
DetachLayerFromAnimationPlayer();
@@ -191,10 +192,12 @@ void LayerAnimator::ResetCompositor(Compositor* compositor) {
}
void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) {
+ // For ui, layer and element ids are equivalent.
+ cc::ElementId element_id(layer_id);
if (!animation_player_->element_id())
- animation_player_->AttachElement(layer_id);
+ animation_player_->AttachElement(element_id);
else
- DCHECK_EQ(animation_player_->element_id(), layer_id);
+ DCHECK_EQ(animation_player_->element_id(), element_id);
animation_player_->set_animation_delegate(this);
}
« third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp ('K') | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698