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

Unified Diff: ui/compositor/layer_animation_element.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 | « ui/compositor/layer_animation_element.h ('k') | ui/compositor/layer_animation_element_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_element.cc
diff --git a/ui/compositor/layer_animation_element.cc b/ui/compositor/layer_animation_element.cc
index 76f8ab7a67867781db7b8c7f51d85f824099a413..6be9da41f130d9ffc7b4932026d7938571a2a088 100644
--- a/ui/compositor/layer_animation_element.cc
+++ b/ui/compositor/layer_animation_element.cc
@@ -414,7 +414,7 @@ class ThreadedLayerAnimationElement : public LayerAnimationElement {
set_effective_start_time(requested_start_time());
return;
}
- set_effective_start_time(base::TimeTicks());
+ set_effective_start_time(gfx::FrameTime());
scoped_ptr<cc::Animation> animation = CreateCCAnimation();
animation->set_needs_synchronized_start_time(true);
delegate->AddThreadedAnimation(animation.Pass());
@@ -734,7 +734,7 @@ LayerAnimationElement::~LayerAnimationElement() {
void LayerAnimationElement::Start(LayerAnimationDelegate* delegate,
int animation_group_id) {
- DCHECK(requested_start_time_ != base::TimeTicks());
+ DCHECK(requested_start_time_ != gfx::FrameTime());
DCHECK(first_frame_);
animation_group_id_ = animation_group_id;
last_progressed_fraction_ = 0.0;
@@ -743,15 +743,15 @@ void LayerAnimationElement::Start(LayerAnimationDelegate* delegate,
first_frame_ = false;
}
-bool LayerAnimationElement::Progress(base::TimeTicks now,
+bool LayerAnimationElement::Progress(gfx::FrameTime now,
LayerAnimationDelegate* delegate) {
- DCHECK(requested_start_time_ != base::TimeTicks());
+ DCHECK(requested_start_time_ != gfx::FrameTime());
DCHECK(!first_frame_);
bool need_draw;
double t = 1.0;
- if ((effective_start_time_ == base::TimeTicks()) ||
+ if ((effective_start_time_ == gfx::FrameTime()) ||
(now < effective_start_time_)) {
// This hasn't actually started yet.
need_draw = false;
@@ -771,12 +771,12 @@ bool LayerAnimationElement::Progress(base::TimeTicks now,
return need_draw;
}
-bool LayerAnimationElement::IsFinished(base::TimeTicks time,
+bool LayerAnimationElement::IsFinished(gfx::FrameTime time,
base::TimeDelta* total_duration) {
// If an effective start has been requested but the effective start time
// hasn't yet been set, the animation is not finished, regardless of the
// value of |time|.
- if (!first_frame_ && (effective_start_time_ == base::TimeTicks()))
+ if (!first_frame_ && (effective_start_time_ == gfx::FrameTime()))
return false;
base::TimeDelta queueing_delay;
@@ -818,7 +818,7 @@ void LayerAnimationElement::Abort(LayerAnimationDelegate* delegate) {
void LayerAnimationElement::RequestEffectiveStart(
LayerAnimationDelegate* delegate) {
- DCHECK(requested_start_time_ != base::TimeTicks());
+ DCHECK(requested_start_time_ != gfx::FrameTime());
effective_start_time_ = requested_start_time_;
}
« no previous file with comments | « ui/compositor/layer_animation_element.h ('k') | ui/compositor/layer_animation_element_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698