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

Unified Diff: cc/test/animation_timelines_test_common.cc

Issue 1957533002: cc : Track opacity animation changes on effect 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 491c996190a18bcbc86e0d21887b8a9591eb1262..b176848cfaeb610f5933947740611e3fd8045440 100644
--- a/cc/test/animation_timelines_test_common.cc
+++ b/cc/test/animation_timelines_test_common.cc
@@ -30,6 +30,8 @@ void TestLayer::ClearMutatedProperties() {
filters_ = FilterOperations();
scroll_offset_ = gfx::ScrollOffset();
transform_is_animating_ = false;
+ has_potential_opacity_animation_ = false;
+ opacity_is_currently_animating_ = false;
for (int i = 0; i <= TargetProperty::LAST_TARGET_PROPERTY; ++i)
mutated_properties_[i] = false;
@@ -130,6 +132,28 @@ void TestHostClient::ElementTransformIsPotentiallyAnimatingChanged(
layer->set_transform_is_animating(is_animating);
}
+void TestHostClient::ElementOpacityIsAnimatingChanged(
+ ElementId element_id,
+ ElementListType list_type,
+ AnimationChangeType change_type,
+ bool is_animating) {
+ TestLayer* layer = FindTestLayer(element_id, list_type);
+ if (layer) {
+ switch (change_type) {
+ case AnimationChangeType::POTENTIAL:
+ layer->set_has_potential_opacity_animation(is_animating);
+ break;
+ case AnimationChangeType::RUNNING:
+ layer->set_opacity_is_currently_animating(is_animating);
+ break;
+ case AnimationChangeType::BOTH:
+ layer->set_has_potential_opacity_animation(is_animating);
+ layer->set_opacity_is_currently_animating(is_animating);
+ break;
+ }
+ }
+}
+
void TestHostClient::SetScrollOffsetForAnimation(
const gfx::ScrollOffset& scroll_offset) {
scroll_offset_ = scroll_offset;
@@ -209,6 +233,22 @@ bool TestHostClient::GetTransformIsAnimating(ElementId element_id,
return layer->transform_is_animating();
}
+bool TestHostClient::GetOpacityIsCurrentlyAnimating(
+ ElementId element_id,
+ ElementListType list_type) const {
+ TestLayer* layer = FindTestLayer(element_id, list_type);
+ EXPECT_TRUE(layer);
+ return layer->opacity_is_currently_animating();
+}
+
+bool TestHostClient::GetHasPotentialOpacityAnimation(
+ ElementId element_id,
+ ElementListType list_type) const {
+ TestLayer* layer = FindTestLayer(element_id, list_type);
+ EXPECT_TRUE(layer);
+ return layer->has_potential_opacity_animation();
+}
+
void TestHostClient::ExpectFilterPropertyMutated(ElementId element_id,
ElementListType list_type,
float brightness) const {
« 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