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..918002a2f1672f493b28fd2d44af81abf8204541 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, |
+ 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,18 @@ base::Time LayerTreeHostImpl::CurrentFrameTime() { |
return current_frame_time_; |
} |
+base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { |
danakj
2013/06/14 18:35:10
Think I'd prefer this is virtual instead of adding
|
+ if (!fake_current_physical_time_for_test_.is_null()) |
+ return fake_current_physical_time_for_test_; |
+ else |
+ return base::TimeTicks::Now(); |
+} |
+ |
+void LayerTreeHostImpl::SetCurrentPhysicalTimeTicksForTest( |
+ base::TimeTicks fake_time) { |
+ fake_current_physical_time_for_test_ = fake_time; |
+} |
+ |
scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const { |
scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
if (this->pending_tree_) |