Index: cc/test/animation_test_common.cc |
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc |
index 13b80ea854cba8d43f943964cf23466ab1838e5e..542ed2746277517a333458bd2b7d70809029a285 100644 |
--- a/cc/test/animation_test_common.cc |
+++ b/cc/test/animation_test_common.cc |
@@ -295,112 +295,122 @@ int AddOpacityStepsToElementAnimations(ElementAnimations* target, |
return id; |
} |
-void AddAnimationToLayerWithPlayer(int layer_id, |
- scoped_refptr<AnimationTimeline> timeline, |
- std::unique_ptr<Animation> animation) { |
+void AddAnimationToElementWithPlayer(ElementId element_id, |
+ scoped_refptr<AnimationTimeline> timeline, |
+ std::unique_ptr<Animation> animation) { |
+ DCHECK(element_id); |
scoped_refptr<AnimationPlayer> player = |
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
timeline->AttachPlayer(player); |
- player->AttachElement(layer_id); |
+ player->AttachElement(element_id); |
DCHECK(player->element_animations()); |
player->AddAnimation(std::move(animation)); |
} |
-void AddAnimationToLayerWithExistingPlayer( |
- int layer_id, |
+void AddAnimationToElementWithExistingPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
std::unique_ptr<Animation> animation) { |
+ DCHECK(element_id); |
scoped_refptr<ElementAnimations> element_animations = |
- timeline->animation_host()->GetElementAnimationsForElementId(layer_id); |
+ timeline->animation_host()->GetElementAnimationsForElementId(element_id); |
DCHECK(element_animations); |
element_animations->AddAnimation(std::move(animation)); |
} |
-void RemoveAnimationFromLayerWithExistingPlayer( |
- int layer_id, |
+void RemoveAnimationFromElementWithExistingPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
int animation_id) { |
+ DCHECK(element_id); |
scoped_refptr<ElementAnimations> element_animations = |
- timeline->animation_host()->GetElementAnimationsForElementId(layer_id); |
+ timeline->animation_host()->GetElementAnimationsForElementId(element_id); |
DCHECK(element_animations); |
element_animations->RemoveAnimation(animation_id); |
} |
-Animation* GetAnimationFromLayerWithExistingPlayer( |
- int layer_id, |
+Animation* GetAnimationFromElementWithExistingPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
int animation_id) { |
+ DCHECK(element_id); |
scoped_refptr<ElementAnimations> element_animations = |
- timeline->animation_host()->GetElementAnimationsForElementId(layer_id); |
+ timeline->animation_host()->GetElementAnimationsForElementId(element_id); |
DCHECK(element_animations); |
return element_animations->GetAnimationById(animation_id); |
} |
-int AddAnimatedFilterToLayerWithPlayer( |
- int layer_id, |
+int AddAnimatedFilterToElementWithPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
double duration, |
float start_brightness, |
float end_brightness) { |
+ DCHECK(element_id); |
scoped_refptr<AnimationPlayer> player = |
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
timeline->AttachPlayer(player); |
- player->AttachElement(layer_id); |
+ player->AttachElement(element_id); |
DCHECK(player->element_animations()); |
return AddAnimatedFilterToPlayer(player.get(), duration, start_brightness, |
end_brightness); |
} |
-int AddAnimatedTransformToLayerWithPlayer( |
- int layer_id, |
+int AddAnimatedTransformToElementWithPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
double duration, |
int delta_x, |
int delta_y) { |
+ DCHECK(element_id); |
scoped_refptr<AnimationPlayer> player = |
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
timeline->AttachPlayer(player); |
- player->AttachElement(layer_id); |
+ player->AttachElement(element_id); |
DCHECK(player->element_animations()); |
return AddAnimatedTransformToPlayer(player.get(), duration, delta_x, delta_y); |
} |
-int AddAnimatedTransformToLayerWithPlayer( |
- int layer_id, |
+int AddAnimatedTransformToElementWithPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
double duration, |
TransformOperations start_operations, |
TransformOperations operations) { |
+ DCHECK(element_id); |
scoped_refptr<AnimationPlayer> player = |
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
timeline->AttachPlayer(player); |
- player->AttachElement(layer_id); |
+ player->AttachElement(element_id); |
DCHECK(player->element_animations()); |
return AddAnimatedTransformToPlayer(player.get(), duration, start_operations, |
operations); |
} |
-int AddOpacityTransitionToLayerWithPlayer( |
- int layer_id, |
+int AddOpacityTransitionToElementWithPlayer( |
+ ElementId element_id, |
scoped_refptr<AnimationTimeline> timeline, |
double duration, |
float start_opacity, |
float end_opacity, |
bool use_timing_function) { |
+ DCHECK(element_id); |
scoped_refptr<AnimationPlayer> player = |
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
timeline->AttachPlayer(player); |
- player->AttachElement(layer_id); |
+ player->AttachElement(element_id); |
DCHECK(player->element_animations()); |
return AddOpacityTransitionToPlayer(player.get(), duration, start_opacity, |
end_opacity, use_timing_function); |
} |
-void AbortAnimationsOnLayerWithPlayer(int layer_id, |
- scoped_refptr<AnimationTimeline> timeline, |
- TargetProperty::Type target_property) { |
+void AbortAnimationsOnElementWithPlayer( |
+ ElementId element_id, |
+ scoped_refptr<AnimationTimeline> timeline, |
+ TargetProperty::Type target_property) { |
+ DCHECK(element_id); |
scoped_refptr<ElementAnimations> element_animations = |
- timeline->animation_host()->GetElementAnimationsForElementId(layer_id); |
+ timeline->animation_host()->GetElementAnimationsForElementId(element_id); |
DCHECK(element_animations); |
element_animations->AbortAnimations(target_property); |
} |