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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 16925007: Fix scrollbar fade animation scheduling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Apply time override using virtual method and apply nits 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index ec59daebabffa8e7d12aef3499182558636e0290..54b845c664c84881ed34bc61ed5f82b947b7eb95 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1927,7 +1927,7 @@ void LayerTreeHostImpl::ScrollEnd() {
if (top_controls_manager_)
top_controls_manager_->ScrollEnd();
ClearCurrentlyScrollingLayer();
- StartScrollbarAnimation(CurrentFrameTimeTicks());
+ StartScrollbarAnimation();
}
InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
@@ -2199,9 +2199,9 @@ void LayerTreeHostImpl::AnimateScrollbarsRecursive(LayerImpl* layer,
AnimateScrollbarsRecursive(layer->children()[i], time);
}
-void LayerTreeHostImpl::StartScrollbarAnimation(base::TimeTicks time) {
+void LayerTreeHostImpl::StartScrollbarAnimation() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::StartScrollbarAnimation");
- StartScrollbarAnimationRecursive(RootLayer(), time);
+ StartScrollbarAnimationRecursive(RootLayer(), CurrentPhysicalTimeTicks());
}
void LayerTreeHostImpl::StartScrollbarAnimationRecursive(LayerImpl* layer,
@@ -2241,10 +2241,11 @@ void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() {
current_frame_time_ = base::Time();
}
-static void UpdateCurrentFrameTime(base::TimeTicks* ticks, base::Time* now) {
+void LayerTreeHostImpl::UpdateCurrentFrameTime(base::TimeTicks* ticks,
danakj 2013/06/14 21:25:23 nit: just pass in the LTHI and you don't have to a
aelias_OOO_until_Jul13 2013/06/14 22:19:02 I think it makes more sense to add it to the class
+ base::Time* now) const {
if (ticks->is_null()) {
DCHECK(now->is_null());
- *ticks = base::TimeTicks::Now();
+ *ticks = CurrentPhysicalTimeTicks();
*now = base::Time::Now();
}
}
@@ -2259,6 +2260,10 @@ base::Time LayerTreeHostImpl::CurrentFrameTime() {
return current_frame_time_;
}
+base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const {
+ return base::TimeTicks::Now();
+}
+
scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const {
scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
if (this->pending_tree_)

Powered by Google App Engine
This is Rietveld 408576698