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

Unified Diff: cc/test/animation_test_common.cc

Issue 2261113002: CC Animation: Introduce some dirty flags to optimize PushProperties on commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more tests. Created 4 years, 4 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/test/animation_test_common.cc
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc
index da3487bfd20a7fd1b96738d9294d97b395b53490..992ab35958467ec045bf4e1c8ab1f267bcbaf0d6 100644
--- a/cc/test/animation_test_common.cc
+++ b/cc/test/animation_test_common.cc
@@ -235,6 +235,7 @@ int AddScrollOffsetAnimationToElementAnimations(ElementAnimations* target,
animation->set_is_impl_only(impl_only);
target->AddAnimation(std::move(animation));
+ target->SetNeedsPushProperties();
ajuma 2016/08/24 15:52:37 Wdyt of making ElementAnimations responsible for s
loyso (OOO) 2016/08/25 00:38:24 ElementAnimations::AddAnimation is a legacy from L
loyso (OOO) 2016/08/25 03:59:02 Done.
return id;
}
@@ -244,6 +245,7 @@ int AddOpacityTransitionToElementAnimations(ElementAnimations* target,
float start_opacity,
float end_opacity,
bool use_timing_function) {
+ target->SetNeedsPushProperties();
return AddOpacityTransition(target, duration, start_opacity, end_opacity,
use_timing_function);
}
@@ -252,6 +254,7 @@ int AddAnimatedTransformToElementAnimations(ElementAnimations* target,
double duration,
int delta_x,
int delta_y) {
+ target->SetNeedsPushProperties();
return AddAnimatedTransform(target, duration, delta_x, delta_y);
}
@@ -259,9 +262,36 @@ int AddAnimatedFilterToElementAnimations(ElementAnimations* target,
double duration,
float start_brightness,
float end_brightness) {
+ target->SetNeedsPushProperties();
return AddAnimatedFilter(target, duration, start_brightness, end_brightness);
}
+void AddAnimationToElementAnimations(ElementAnimations* target,
+ std::unique_ptr<Animation> animation) {
+ target->SetNeedsPushProperties();
+ target->AddAnimation(std::move(animation));
+}
+
+void RemoveAnimationFromElementAnimations(ElementAnimations* target,
+ int animation_id) {
+ target->SetNeedsPushProperties();
+ target->RemoveAnimation(animation_id);
+}
+
+void PauseAnimationInElementAnimations(ElementAnimations* target,
+ int animation_id,
+ base::TimeDelta time) {
+ target->SetNeedsPushProperties();
+ target->PauseAnimation(animation_id, time);
+}
+
+void AbortAnimationsInElementAnimations(ElementAnimations* target,
+ TargetProperty::Type target_property,
+ bool needs_completion) {
+ target->SetNeedsPushProperties();
+ target->AbortAnimations(target_property, needs_completion);
+}
+
int AddAnimatedTransformToPlayer(AnimationPlayer* player,
double duration,
int delta_x,
@@ -316,6 +346,8 @@ int AddOpacityStepsToElementAnimations(ElementAnimations* target,
animation->set_needs_synchronized_start_time(true);
target->AddAnimation(std::move(animation));
+ target->SetNeedsPushProperties();
+
return id;
}
@@ -338,6 +370,7 @@ void AddAnimationToElementWithExistingPlayer(
timeline->animation_host()->GetElementAnimationsForElementId(element_id);
DCHECK(element_animations);
element_animations->AddAnimation(std::move(animation));
+ element_animations->SetNeedsPushProperties();
}
void RemoveAnimationFromElementWithExistingPlayer(
@@ -348,6 +381,7 @@ void RemoveAnimationFromElementWithExistingPlayer(
timeline->animation_host()->GetElementAnimationsForElementId(element_id);
DCHECK(element_animations);
element_animations->RemoveAnimation(animation_id);
+ element_animations->SetNeedsPushProperties();
}
Animation* GetAnimationFromElementWithExistingPlayer(
@@ -428,6 +462,7 @@ void AbortAnimationsOnElementWithPlayer(
timeline->animation_host()->GetElementAnimationsForElementId(element_id);
DCHECK(element_animations);
element_animations->AbortAnimations(target_property);
+ element_animations->SetNeedsPushProperties();
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698