| 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/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 DCHECK(IsActiveTree()); | 248 DCHECK(IsActiveTree()); |
| 249 return currently_scrolling_layer_; | 249 return currently_scrolling_layer_; |
| 250 } | 250 } |
| 251 | 251 |
| 252 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { | 252 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { |
| 253 if (currently_scrolling_layer_ == layer) | 253 if (currently_scrolling_layer_ == layer) |
| 254 return; | 254 return; |
| 255 | 255 |
| 256 if (currently_scrolling_layer_ && | 256 if (currently_scrolling_layer_ && |
| 257 currently_scrolling_layer_->scrollbar_animation_controller()) | 257 currently_scrolling_layer_->scrollbar_animation_controller()) |
| 258 currently_scrolling_layer_->scrollbar_animation_controller()-> | 258 currently_scrolling_layer_->scrollbar_animation_controller() |
| 259 DidScrollGestureEnd(CurrentPhysicalTimeTicks()); | 259 ->DidScrollGestureEnd(CurrentFrameTimeTicks()); |
| 260 currently_scrolling_layer_ = layer; | 260 currently_scrolling_layer_ = layer; |
| 261 if (layer && layer->scrollbar_animation_controller()) | 261 if (layer && layer->scrollbar_animation_controller()) |
| 262 layer->scrollbar_animation_controller()->DidScrollGestureBegin(); | 262 layer->scrollbar_animation_controller()->DidScrollGestureBegin(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void LayerTreeImpl::ClearCurrentlyScrollingLayer() { | 265 void LayerTreeImpl::ClearCurrentlyScrollingLayer() { |
| 266 SetCurrentlyScrollingLayer(NULL); | 266 SetCurrentlyScrollingLayer(NULL); |
| 267 scrolling_layer_id_from_previous_tree_ = 0; | 267 scrolling_layer_id_from_previous_tree_ = 0; |
| 268 } | 268 } |
| 269 | 269 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 } | 675 } |
| 676 | 676 |
| 677 bool LayerTreeImpl::PinchGestureActive() const { | 677 bool LayerTreeImpl::PinchGestureActive() const { |
| 678 return layer_tree_host_impl_->pinch_gesture_active(); | 678 return layer_tree_host_impl_->pinch_gesture_active(); |
| 679 } | 679 } |
| 680 | 680 |
| 681 base::TimeTicks LayerTreeImpl::CurrentFrameTimeTicks() const { | 681 base::TimeTicks LayerTreeImpl::CurrentFrameTimeTicks() const { |
| 682 return layer_tree_host_impl_->CurrentFrameTimeTicks(); | 682 return layer_tree_host_impl_->CurrentFrameTimeTicks(); |
| 683 } | 683 } |
| 684 | 684 |
| 685 base::TimeTicks LayerTreeImpl::CurrentPhysicalTimeTicks() const { | |
| 686 return layer_tree_host_impl_->CurrentPhysicalTimeTicks(); | |
| 687 } | |
| 688 | |
| 689 void LayerTreeImpl::SetNeedsCommit() { | 685 void LayerTreeImpl::SetNeedsCommit() { |
| 690 layer_tree_host_impl_->SetNeedsCommit(); | 686 layer_tree_host_impl_->SetNeedsCommit(); |
| 691 } | 687 } |
| 692 | 688 |
| 693 gfx::Size LayerTreeImpl::DrawViewportSize() const { | 689 gfx::Size LayerTreeImpl::DrawViewportSize() const { |
| 694 return layer_tree_host_impl_->DrawViewportSize(); | 690 return layer_tree_host_impl_->DrawViewportSize(); |
| 695 } | 691 } |
| 696 | 692 |
| 697 void LayerTreeImpl::StartScrollbarAnimation() { | 693 void LayerTreeImpl::StartScrollbarAnimation() { |
| 698 layer_tree_host_impl_->StartScrollbarAnimation(); | 694 layer_tree_host_impl_->StartScrollbarAnimation(); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() | 950 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() |
| 955 const { | 951 const { |
| 956 // Only the active tree needs to know about layers with copy requests, as | 952 // Only the active tree needs to know about layers with copy requests, as |
| 957 // they are aborted if not serviced during draw. | 953 // they are aborted if not serviced during draw. |
| 958 DCHECK(IsActiveTree()); | 954 DCHECK(IsActiveTree()); |
| 959 | 955 |
| 960 return layers_with_copy_output_request_; | 956 return layers_with_copy_output_request_; |
| 961 } | 957 } |
| 962 | 958 |
| 963 } // namespace cc | 959 } // namespace cc |
| OLD | NEW |