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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index cfd8a1489af4a06f045b1b817c18b83ed721c852..9c346e23a84c732e7ff67b314f11d083c9eb864d 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -348,8 +348,9 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree
LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree()
: active_tree_was_animated_(false) {}
- base::TimeDelta LowFrequencyAnimationInterval() const override {
- return base::TimeDelta::FromMilliseconds(4);
+ base::TimeDelta BackgroundAnimationInterval(LayerTreeHostImpl* host_impl) {
+ return base::TimeDelta::FromSecondsD(
+ 1.0 / host_impl->settings().background_animation_rate);
}
void BeginTest() override {
@@ -409,10 +410,9 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree
FROM_HERE,
base::Bind(
&LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree::
- UnblockActivations,
- base::Unretained(this),
- host_impl),
- 4 * LowFrequencyAnimationInterval());
+ UnblockActivations,
+ base::Unretained(this), host_impl),
+ 4 * BackgroundAnimationInterval(host_impl));
}
}
@@ -447,10 +447,9 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree
FROM_HERE,
base::Bind(
&LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree::
- InitiateNextCommit,
- base::Unretained(this),
- host_impl),
- 4 * LowFrequencyAnimationInterval());
+ InitiateNextCommit,
+ base::Unretained(this), host_impl),
+ 4 * BackgroundAnimationInterval(host_impl));
}
}
@@ -505,10 +504,10 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction
const FloatAnimationCurve* curve =
animation->curve()->ToFloatAnimationCurve();
float start_opacity = curve->GetValue(0.0);
- float end_opacity = curve->GetValue(curve->Duration());
+ float end_opacity = curve->GetValue(curve->Duration().InSecondsF());
float linearly_interpolated_opacity =
0.25f * end_opacity + 0.75f * start_opacity;
- double time = curve->Duration() * 0.25;
+ double time = curve->Duration().InSecondsF() * 0.25;
// If the linear timing function associated with this animation was not
// picked up, then the linearly interpolated opacity would be different
// because of the default ease timing function.
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698