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

Unified Diff: cc/trees/thread_proxy.cc

Issue 16925007: Fix scrollbar fade animation scheduling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename fake_time to fake_now Created 7 years, 6 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/trees/layer_tree_settings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 98512468c3235cfd7ba57fd6fab45e44aebdeb14..ce2c0f7bf33b9beb6dc7faef8a37f3582949ceb7 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -605,7 +605,8 @@ void ThreadProxy::ScheduledActionSendBeginFrameToMainThread() {
TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionSendBeginFrameToMainThread");
scoped_ptr<BeginFrameAndCommitState> begin_frame_state(
new BeginFrameAndCommitState);
- begin_frame_state->monotonic_frame_begin_time = base::TimeTicks::Now();
+ begin_frame_state->monotonic_frame_begin_time =
+ layer_tree_host_impl_->CurrentPhysicalTimeTicks();
begin_frame_state->scroll_info =
layer_tree_host_impl_->ProcessScrollDeltas();
DCHECK_GT(layer_tree_host_impl_->memory_allocation_limit_bytes(), 0u);
@@ -1300,19 +1301,20 @@ void ThreadProxy::RenewTreePriority() {
layer_tree_host_impl_->CurrentlyScrollingLayer() ||
layer_tree_host_impl_->page_scale_animation_active();
+ base::TimeTicks now = layer_tree_host_impl_->CurrentPhysicalTimeTicks();
+
// Update expiration time if smoothness currently takes priority.
if (smoothness_takes_priority) {
smoothness_takes_priority_expiration_time_ =
- base::TimeTicks::Now() +
- base::TimeDelta::FromMilliseconds(
- kSmoothnessTakesPriorityExpirationDelay * 1000);
+ now + base::TimeDelta::FromMilliseconds(
+ kSmoothnessTakesPriorityExpirationDelay * 1000);
}
// We use the same priority for both trees by default.
TreePriority priority = SAME_PRIORITY_FOR_BOTH_TREES;
// Smoothness takes priority if expiration time is in the future.
- if (smoothness_takes_priority_expiration_time_ > base::TimeTicks::Now())
+ if (smoothness_takes_priority_expiration_time_ > now)
priority = SMOOTHNESS_TAKES_PRIORITY;
// New content always takes priority when the active tree has
@@ -1331,8 +1333,7 @@ void ThreadProxy::RenewTreePriority() {
UpdateSmoothnessTakesPriority(priority == SMOOTHNESS_TAKES_PRIORITY);
}
- base::TimeDelta delay =
- smoothness_takes_priority_expiration_time_ - base::TimeTicks::Now();
+ base::TimeDelta delay = smoothness_takes_priority_expiration_time_ - now;
// Need to make sure a delayed task is posted when we have smoothness
// takes priority expiration time in the future.
@@ -1364,8 +1365,7 @@ void ThreadProxy::RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) {
}
void ThreadProxy::StartScrollbarAnimationOnImplThread() {
- layer_tree_host_impl_->StartScrollbarAnimation(
- layer_tree_host_impl_->CurrentFrameTimeTicks());
+ layer_tree_host_impl_->StartScrollbarAnimation();
}
void ThreadProxy::DidActivatePendingTree() {
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698