| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/animation/keyframed_animation_curve.h" | 8 #include "cc/animation/keyframed_animation_curve.h" |
| 9 #include "cc/animation/scrollbar_animation_controller.h" | 9 #include "cc/animation/scrollbar_animation_controller.h" |
| 10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 return currently_scrolling_layer_; | 149 return currently_scrolling_layer_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { | 152 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { |
| 153 if (currently_scrolling_layer_ == layer) | 153 if (currently_scrolling_layer_ == layer) |
| 154 return; | 154 return; |
| 155 | 155 |
| 156 if (currently_scrolling_layer_ && | 156 if (currently_scrolling_layer_ && |
| 157 currently_scrolling_layer_->scrollbar_animation_controller()) | 157 currently_scrolling_layer_->scrollbar_animation_controller()) |
| 158 currently_scrolling_layer_->scrollbar_animation_controller()-> | 158 currently_scrolling_layer_->scrollbar_animation_controller()-> |
| 159 DidScrollGestureEnd(CurrentFrameTimeTicks()); | 159 DidScrollGestureEnd(base::TimeTicks::Now()); |
| 160 currently_scrolling_layer_ = layer; | 160 currently_scrolling_layer_ = layer; |
| 161 if (layer && layer->scrollbar_animation_controller()) | 161 if (layer && layer->scrollbar_animation_controller()) |
| 162 layer->scrollbar_animation_controller()->DidScrollGestureBegin(); | 162 layer->scrollbar_animation_controller()->DidScrollGestureBegin(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void LayerTreeImpl::ClearCurrentlyScrollingLayer() { | 165 void LayerTreeImpl::ClearCurrentlyScrollingLayer() { |
| 166 SetCurrentlyScrollingLayer(NULL); | 166 SetCurrentlyScrollingLayer(NULL); |
| 167 scrolling_layer_id_from_previous_tree_ = 0; | 167 scrolling_layer_id_from_previous_tree_ = 0; |
| 168 } | 168 } |
| 169 | 169 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 } | 461 } |
| 462 | 462 |
| 463 base::TimeTicks LayerTreeImpl::CurrentFrameTimeTicks() const { | 463 base::TimeTicks LayerTreeImpl::CurrentFrameTimeTicks() const { |
| 464 return layer_tree_host_impl_->CurrentFrameTimeTicks(); | 464 return layer_tree_host_impl_->CurrentFrameTimeTicks(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 base::Time LayerTreeImpl::CurrentFrameTime() const { | 467 base::Time LayerTreeImpl::CurrentFrameTime() const { |
| 468 return layer_tree_host_impl_->CurrentFrameTime(); | 468 return layer_tree_host_impl_->CurrentFrameTime(); |
| 469 } | 469 } |
| 470 | 470 |
| 471 base::TimeTicks LayerTreeImpl::CurrentPhysicalTimeTicks() const { |
| 472 return layer_tree_host_impl_->CurrentPhysicalTimeTicks(); |
| 473 } |
| 474 |
| 471 void LayerTreeImpl::SetNeedsCommit() { | 475 void LayerTreeImpl::SetNeedsCommit() { |
| 472 layer_tree_host_impl_->SetNeedsCommit(); | 476 layer_tree_host_impl_->SetNeedsCommit(); |
| 473 } | 477 } |
| 474 | 478 |
| 475 void LayerTreeImpl::SetNeedsRedraw() { | 479 void LayerTreeImpl::SetNeedsRedraw() { |
| 476 layer_tree_host_impl_->SetNeedsRedraw(); | 480 layer_tree_host_impl_->SetNeedsRedraw(); |
| 477 } | 481 } |
| 478 | 482 |
| 479 const LayerTreeDebugState& LayerTreeImpl::debug_state() const { | 483 const LayerTreeDebugState& LayerTreeImpl::debug_state() const { |
| 480 return layer_tree_host_impl_->debug_state(); | 484 return layer_tree_host_impl_->debug_state(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 567 |
| 564 void LayerTreeImpl::ClearLatencyInfo() { | 568 void LayerTreeImpl::ClearLatencyInfo() { |
| 565 latency_info_.Clear(); | 569 latency_info_.Clear(); |
| 566 } | 570 } |
| 567 | 571 |
| 568 void LayerTreeImpl::WillModifyTilePriorities() { | 572 void LayerTreeImpl::WillModifyTilePriorities() { |
| 569 layer_tree_host_impl_->SetNeedsManageTiles(); | 573 layer_tree_host_impl_->SetNeedsManageTiles(); |
| 570 } | 574 } |
| 571 | 575 |
| 572 } // namespace cc | 576 } // namespace cc |
| OLD | NEW |