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

Unified Diff: cc/input/top_controls_manager.cc

Issue 26880010: gfx: Add FrameTime and DisplayTime classes (Closed) Base URL: http://git.chromium.org/chromium/src.git@checkHighResNow4
Patch Set: WIP Created 7 years, 2 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/input/top_controls_manager.h ('k') | cc/layers/heads_up_display_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/top_controls_manager.cc
diff --git a/cc/input/top_controls_manager.cc b/cc/input/top_controls_manager.cc
index a0e61aaa325b49a83021825cf17d78626c5b332a..1220a0071193e43eb60c6111bb64726904b9a888 100644
--- a/cc/input/top_controls_manager.cc
+++ b/cc/input/top_controls_manager.cc
@@ -136,11 +136,11 @@ void TopControlsManager::SetControlsTopOffset(float controls_top_offset) {
client_->DidChangeTopControlsPosition();
}
-gfx::Vector2dF TopControlsManager::Animate(base::TimeTicks monotonic_time) {
+gfx::Vector2dF TopControlsManager::Animate(gfx::FrameTime monotonic_time) {
if (!top_controls_animation_ || !client_->HaveRootScrollLayer())
return gfx::Vector2dF();
- double time = (monotonic_time - base::TimeTicks()).InMillisecondsF();
+ double time = monotonic_time.Unsafe_InMillisecondsF();
float old_offset = controls_top_offset_;
SetControlsTopOffset(top_controls_animation_->GetValue(time));
@@ -175,7 +175,7 @@ void TopControlsManager::SetupAnimation(AnimationDirection direction) {
top_controls_animation_ = KeyframedFloatAnimationCurve::Create();
double start_time =
- (gfx::FrameTime::Now() - base::TimeTicks()).InMillisecondsF();
+ gfx::FrameTime::Now().Unsafe_InMillisecondsF();
top_controls_animation_->AddKeyframe(
FloatKeyframe::Create(start_time, controls_top_offset_,
scoped_ptr<TimingFunction>()));
@@ -213,11 +213,12 @@ void TopControlsManager::StartAnimationIfNecessary() {
}
}
-bool TopControlsManager::IsAnimationCompleteAtTime(base::TimeTicks time) {
+bool TopControlsManager::IsAnimationCompleteAtTime(
+ gfx::FrameTime time) {
if (!top_controls_animation_)
return true;
- double time_ms = (time - base::TimeTicks()).InMillisecondsF();
+ double time_ms = time.Unsafe_InMillisecondsF();
float new_offset = top_controls_animation_->GetValue(time_ms);
if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) ||
« no previous file with comments | « cc/input/top_controls_manager.h ('k') | cc/layers/heads_up_display_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698