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

Unified Diff: cc/animation/scrollbar_animation_controller_linear_fade.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
Index: cc/animation/scrollbar_animation_controller_linear_fade.cc
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.cc b/cc/animation/scrollbar_animation_controller_linear_fade.cc
index 863959b84c27691f9afe1cca9628b399fc3b04e9..52298d19aeda08a1f2ffd5e6ad9d579b66dae4e7 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.cc
@@ -37,17 +37,17 @@ bool ScrollbarAnimationControllerLinearFade::IsAnimating() const {
}
base::TimeDelta ScrollbarAnimationControllerLinearFade::DelayBeforeStart(
- base::TimeTicks now) const {
+ gfx::FrameTime now) const {
if (now > last_awaken_time_ + fadeout_delay_)
return base::TimeDelta();
return fadeout_delay_ - (now - last_awaken_time_);
}
-bool ScrollbarAnimationControllerLinearFade::Animate(base::TimeTicks now) {
+bool ScrollbarAnimationControllerLinearFade::Animate(gfx::FrameTime now) {
float opacity = OpacityAtTime(now);
ApplyOpacityToScrollbars(opacity);
if (!opacity)
- last_awaken_time_ = base::TimeTicks();
+ last_awaken_time_ = gfx::FrameTime();
return IsAnimating() && DelayBeforeStart(now) == base::TimeDelta();
}
@@ -57,7 +57,7 @@ void ScrollbarAnimationControllerLinearFade::DidScrollGestureBegin() {
}
void ScrollbarAnimationControllerLinearFade::DidScrollGestureEnd(
- base::TimeTicks now) {
+ gfx::FrameTime now) {
// The animation should not be triggered if no scrolling has occurred.
if (scroll_gesture_has_scrolled_)
last_awaken_time_ = now;
@@ -65,18 +65,18 @@ void ScrollbarAnimationControllerLinearFade::DidScrollGestureEnd(
scroll_gesture_in_progress_ = false;
}
-void ScrollbarAnimationControllerLinearFade::DidMouseMoveOffScrollbar(
- base::TimeTicks now) {
+void ScrollbarAnimationControllerLinearFade::DidMouseMoveOffScrollbar(\
+ gfx::FrameTime now) {
// Ignore mouse move events.
}
bool ScrollbarAnimationControllerLinearFade::DidScrollUpdate(
- base::TimeTicks now) {
+ gfx::FrameTime now) {
ApplyOpacityToScrollbars(1.0f);
// The animation should only be activated if the scroll updated occurred
// programatically, outside the scope of a scroll gesture.
if (scroll_gesture_in_progress_) {
- last_awaken_time_ = base::TimeTicks();
+ last_awaken_time_ = gfx::FrameTime();
scroll_gesture_has_scrolled_ = true;
return false;
}
@@ -86,13 +86,13 @@ bool ScrollbarAnimationControllerLinearFade::DidScrollUpdate(
}
bool ScrollbarAnimationControllerLinearFade::DidMouseMoveNear(
- base::TimeTicks now, float distance) {
+ gfx::FrameTime now, float distance) {
// Ignore mouse move events.
return false;
}
float ScrollbarAnimationControllerLinearFade::OpacityAtTime(
- base::TimeTicks now) {
+ gfx::FrameTime now) {
if (scroll_gesture_has_scrolled_)
return 1.0f;

Powered by Google App Engine
This is Rietveld 408576698