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

Unified Diff: ui/compositor/layer_animation_sequence.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_sequence.h ('k') | ui/compositor/layer_animation_sequence_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_sequence.cc
diff --git a/ui/compositor/layer_animation_sequence.cc b/ui/compositor/layer_animation_sequence.cc
index 9ebf1e0552bc596c08c5d9edcf0ada590db0a203..f2b6b01acec44818bce58ad37aec67b6593646f0 100644
--- a/ui/compositor/layer_animation_sequence.cc
+++ b/ui/compositor/layer_animation_sequence.cc
@@ -12,6 +12,7 @@
#include "ui/compositor/layer_animation_delegate.h"
#include "ui/compositor/layer_animation_element.h"
#include "ui/compositor/layer_animation_observer.h"
+#include "ui/gfx/frame_time.h"
namespace ui {
@@ -41,7 +42,7 @@ LayerAnimationSequence::~LayerAnimationSequence() {
}
void LayerAnimationSequence::Start(LayerAnimationDelegate* delegate) {
- DCHECK(start_time_ != base::TimeTicks());
+ DCHECK(start_time_ != gfx::FrameTime());
last_progressed_fraction_ = 0.0;
if (elements_.empty())
return;
@@ -50,9 +51,9 @@ void LayerAnimationSequence::Start(LayerAnimationDelegate* delegate) {
elements_[0]->Start(delegate, animation_group_id_);
}
-void LayerAnimationSequence::Progress(base::TimeTicks now,
+void LayerAnimationSequence::Progress(gfx::FrameTime now,
LayerAnimationDelegate* delegate) {
- DCHECK(start_time_ != base::TimeTicks());
+ DCHECK(start_time_ != gfx::FrameTime());
bool redraw_required = false;
if (elements_.empty())
@@ -105,7 +106,7 @@ void LayerAnimationSequence::Progress(base::TimeTicks now,
}
}
-bool LayerAnimationSequence::IsFinished(base::TimeTicks time) {
+bool LayerAnimationSequence::IsFinished(gfx::FrameTime time) {
if (is_cyclic_ || waiting_for_group_start_)
return false;
@@ -115,7 +116,7 @@ bool LayerAnimationSequence::IsFinished(base::TimeTicks time) {
if (last_element_ == 0)
last_start_ = start_time_;
- base::TimeTicks current_start = last_start_;
+ gfx::FrameTime current_start = last_start_;
size_t current_index = last_element_;
base::TimeDelta element_duration;
while (current_index < elements_.size()) {
@@ -225,8 +226,7 @@ void LayerAnimationSequence::OnThreadedAnimationStarted(
LayerAnimationElement::ToAnimatableProperty(event.target_property);
DCHECK(element_properties.find(event_property) != element_properties.end());
elements_[current_index]->set_effective_start_time(
- base::TimeTicks::FromInternalValue(
- event.monotonic_time * base::Time::kMicrosecondsPerSecond));
+ gfx::FrameTime::Unsafe_FromSecondsF(event.monotonic_time));
}
void LayerAnimationSequence::OnScheduled() {
« no previous file with comments | « ui/compositor/layer_animation_sequence.h ('k') | ui/compositor/layer_animation_sequence_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698