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

Unified Diff: cc/animation/animation_host.cc

Issue 1698813002: CC Animation: Expose TargetProperty enum to be aliased in Blink Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use custom hash in unordered_set. Created 4 years, 10 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: cc/animation/animation_host.cc
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index cf34e38d7442e6e9b5e8346b2545352bcc55fd4b..5eb598c7813cc9921d639612895861c0711f1fa0 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -54,7 +54,8 @@ class AnimationHost::ScrollOffsetAnimations : public AnimationDelegate {
scoped_ptr<Animation> animation = Animation::Create(
std::move(curve), AnimationIdProvider::NextAnimationId(),
- AnimationIdProvider::NextGroupId(), Animation::SCROLL_OFFSET);
+ AnimationIdProvider::NextGroupId(),
+ AnimationTargetProperty::SCROLL_OFFSET);
animation->set_is_impl_only(true);
DCHECK(scroll_offset_animation_player_);
@@ -75,9 +76,10 @@ class AnimationHost::ScrollOffsetAnimations : public AnimationDelegate {
DCHECK_EQ(layer_id, scroll_offset_animation_player_->layer_id());
- Animation* animation = scroll_offset_animation_player_->element_animations()
- ->layer_animation_controller()
- ->GetAnimation(Animation::SCROLL_OFFSET);
+ Animation* animation =
+ scroll_offset_animation_player_->element_animations()
+ ->layer_animation_controller()
+ ->GetAnimation(AnimationTargetProperty::SCROLL_OFFSET);
if (!animation) {
scroll_offset_animation_player_->DetachLayer();
return false;
@@ -100,22 +102,23 @@ class AnimationHost::ScrollOffsetAnimations : public AnimationDelegate {
void ScrollAnimationAbort() {
DCHECK(scroll_offset_animation_player_);
- scroll_offset_animation_player_->AbortAnimations(Animation::SCROLL_OFFSET);
+ scroll_offset_animation_player_->AbortAnimations(
+ AnimationTargetProperty::SCROLL_OFFSET);
}
// AnimationDelegate implementation.
void NotifyAnimationStarted(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
+ AnimationTargetProperty target_property,
int group) override {}
void NotifyAnimationFinished(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
+ AnimationTargetProperty target_property,
int group) override {
- DCHECK_EQ(target_property, Animation::SCROLL_OFFSET);
+ DCHECK_EQ(target_property, AnimationTargetProperty::SCROLL_OFFSET);
DCHECK(animation_host_->mutator_host_client());
animation_host_->mutator_host_client()->ScrollOffsetAnimationFinished();
}
void NotifyAnimationAborted(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
+ AnimationTargetProperty target_property,
int group) override {}
private:
@@ -392,7 +395,8 @@ bool AnimationHost::IsAnimatingFilterProperty(int layer_id,
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
return controller
? controller->IsCurrentlyAnimatingProperty(
- Animation::FILTER, ObserverTypeFromTreeType(tree_type))
+ AnimationTargetProperty::FILTER,
+ ObserverTypeFromTreeType(tree_type))
: false;
}
@@ -401,7 +405,8 @@ bool AnimationHost::IsAnimatingOpacityProperty(int layer_id,
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
return controller
? controller->IsCurrentlyAnimatingProperty(
- Animation::OPACITY, ObserverTypeFromTreeType(tree_type))
+ AnimationTargetProperty::OPACITY,
+ ObserverTypeFromTreeType(tree_type))
: false;
}
@@ -411,7 +416,8 @@ bool AnimationHost::IsAnimatingTransformProperty(
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
return controller
? controller->IsCurrentlyAnimatingProperty(
- Animation::TRANSFORM, ObserverTypeFromTreeType(tree_type))
+ AnimationTargetProperty::TRANSFORM,
+ ObserverTypeFromTreeType(tree_type))
: false;
}
@@ -421,7 +427,8 @@ bool AnimationHost::HasPotentiallyRunningFilterAnimation(
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
return controller
? controller->IsPotentiallyAnimatingProperty(
- Animation::FILTER, ObserverTypeFromTreeType(tree_type))
+ AnimationTargetProperty::FILTER,
+ ObserverTypeFromTreeType(tree_type))
: false;
}
@@ -431,7 +438,8 @@ bool AnimationHost::HasPotentiallyRunningOpacityAnimation(
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
return controller
? controller->IsPotentiallyAnimatingProperty(
- Animation::OPACITY, ObserverTypeFromTreeType(tree_type))
+ AnimationTargetProperty::OPACITY,
+ ObserverTypeFromTreeType(tree_type))
: false;
}
@@ -441,13 +449,14 @@ bool AnimationHost::HasPotentiallyRunningTransformAnimation(
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
return controller
? controller->IsPotentiallyAnimatingProperty(
- Animation::TRANSFORM, ObserverTypeFromTreeType(tree_type))
+ AnimationTargetProperty::TRANSFORM,
+ ObserverTypeFromTreeType(tree_type))
: false;
}
bool AnimationHost::HasAnyAnimationTargetingProperty(
int layer_id,
- Animation::TargetProperty property) const {
+ AnimationTargetProperty property) const {
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
if (!controller)
return false;
@@ -460,7 +469,8 @@ bool AnimationHost::FilterIsAnimatingOnImplOnly(int layer_id) const {
if (!controller)
return false;
- Animation* animation = controller->GetAnimation(Animation::FILTER);
+ Animation* animation =
+ controller->GetAnimation(AnimationTargetProperty::FILTER);
return animation && animation->is_impl_only();
}
@@ -469,7 +479,8 @@ bool AnimationHost::OpacityIsAnimatingOnImplOnly(int layer_id) const {
if (!controller)
return false;
- Animation* animation = controller->GetAnimation(Animation::OPACITY);
+ Animation* animation =
+ controller->GetAnimation(AnimationTargetProperty::OPACITY);
return animation && animation->is_impl_only();
}
@@ -478,7 +489,8 @@ bool AnimationHost::TransformIsAnimatingOnImplOnly(int layer_id) const {
if (!controller)
return false;
- Animation* animation = controller->GetAnimation(Animation::TRANSFORM);
+ Animation* animation =
+ controller->GetAnimation(AnimationTargetProperty::TRANSFORM);
return animation && animation->is_impl_only();
}

Powered by Google App Engine
This is Rietveld 408576698