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

Unified Diff: cc/test/animation_timelines_test_common.cc

Issue 1987123002: cc : Track transform animation changes on transform tree (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
« no previous file with comments | « cc/test/animation_timelines_test_common.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/animation_timelines_test_common.cc
diff --git a/cc/test/animation_timelines_test_common.cc b/cc/test/animation_timelines_test_common.cc
index b176848cfaeb610f5933947740611e3fd8045440..d92eeff38669fd9b083e6436c251ba9c9767ee57 100644
--- a/cc/test/animation_timelines_test_common.cc
+++ b/cc/test/animation_timelines_test_common.cc
@@ -29,7 +29,8 @@ void TestLayer::ClearMutatedProperties() {
opacity_ = 0;
filters_ = FilterOperations();
scroll_offset_ = gfx::ScrollOffset();
- transform_is_animating_ = false;
+ has_potential_transform_animation_ = false;
+ transform_is_currently_animating_ = false;
has_potential_opacity_animation_ = false;
opacity_is_currently_animating_ = false;
@@ -123,13 +124,26 @@ void TestHostClient::SetElementScrollOffsetMutated(
layer->set_scroll_offset(scroll_offset);
}
-void TestHostClient::ElementTransformIsPotentiallyAnimatingChanged(
+void TestHostClient::ElementTransformIsAnimatingChanged(
ElementId element_id,
ElementListType list_type,
+ AnimationChangeType change_type,
bool is_animating) {
TestLayer* layer = FindTestLayer(element_id, list_type);
- if (layer)
- layer->set_transform_is_animating(is_animating);
+ if (layer) {
+ switch (change_type) {
+ case AnimationChangeType::POTENTIAL:
+ layer->set_has_potential_transform_animation(is_animating);
+ break;
+ case AnimationChangeType::RUNNING:
+ layer->set_transform_is_currently_animating(is_animating);
+ break;
+ case AnimationChangeType::BOTH:
+ layer->set_has_potential_transform_animation(is_animating);
+ layer->set_transform_is_currently_animating(is_animating);
+ break;
+ }
+ }
}
void TestHostClient::ElementOpacityIsAnimatingChanged(
@@ -226,11 +240,20 @@ gfx::ScrollOffset TestHostClient::GetScrollOffset(
return layer->scroll_offset();
}
-bool TestHostClient::GetTransformIsAnimating(ElementId element_id,
- ElementListType list_type) const {
+bool TestHostClient::GetTransformIsCurrentlyAnimating(
+ ElementId element_id,
+ ElementListType list_type) const {
+ TestLayer* layer = FindTestLayer(element_id, list_type);
+ EXPECT_TRUE(layer);
+ return layer->transform_is_currently_animating();
+}
+
+bool TestHostClient::GetHasPotentialTransformAnimation(
+ ElementId element_id,
+ ElementListType list_type) const {
TestLayer* layer = FindTestLayer(element_id, list_type);
EXPECT_TRUE(layer);
- return layer->transform_is_animating();
+ return layer->has_potential_transform_animation();
}
bool TestHostClient::GetOpacityIsCurrentlyAnimating(
« no previous file with comments | « cc/test/animation_timelines_test_common.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698