| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 return currently_scrolling_layer_; | 169 return currently_scrolling_layer_; |
| 170 } | 170 } |
| 171 | 171 |
| 172 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { | 172 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { |
| 173 if (currently_scrolling_layer_ == layer) | 173 if (currently_scrolling_layer_ == layer) |
| 174 return; | 174 return; |
| 175 | 175 |
| 176 if (currently_scrolling_layer_ && | 176 if (currently_scrolling_layer_ && |
| 177 currently_scrolling_layer_->scrollbar_animation_controller()) | 177 currently_scrolling_layer_->scrollbar_animation_controller()) |
| 178 currently_scrolling_layer_->scrollbar_animation_controller()-> | 178 currently_scrolling_layer_->scrollbar_animation_controller()-> |
| 179 DidScrollGestureEnd(CurrentPhysicalTimeTicks()); | 179 DidScrollGestureEnd(CurrentPhysicalFrameTime()); |
| 180 currently_scrolling_layer_ = layer; | 180 currently_scrolling_layer_ = layer; |
| 181 if (layer && layer->scrollbar_animation_controller()) | 181 if (layer && layer->scrollbar_animation_controller()) |
| 182 layer->scrollbar_animation_controller()->DidScrollGestureBegin(); | 182 layer->scrollbar_animation_controller()->DidScrollGestureBegin(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void LayerTreeImpl::ClearCurrentlyScrollingLayer() { | 185 void LayerTreeImpl::ClearCurrentlyScrollingLayer() { |
| 186 SetCurrentlyScrollingLayer(NULL); | 186 SetCurrentlyScrollingLayer(NULL); |
| 187 scrolling_layer_id_from_previous_tree_ = 0; | 187 scrolling_layer_id_from_previous_tree_ = 0; |
| 188 } | 188 } |
| 189 | 189 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 } | 570 } |
| 571 | 571 |
| 572 int LayerTreeImpl::MaxTextureSize() const { | 572 int LayerTreeImpl::MaxTextureSize() const { |
| 573 return layer_tree_host_impl_->GetRendererCapabilities().max_texture_size; | 573 return layer_tree_host_impl_->GetRendererCapabilities().max_texture_size; |
| 574 } | 574 } |
| 575 | 575 |
| 576 bool LayerTreeImpl::PinchGestureActive() const { | 576 bool LayerTreeImpl::PinchGestureActive() const { |
| 577 return layer_tree_host_impl_->pinch_gesture_active(); | 577 return layer_tree_host_impl_->pinch_gesture_active(); |
| 578 } | 578 } |
| 579 | 579 |
| 580 base::TimeTicks LayerTreeImpl::CurrentFrameTimeTicks() const { | 580 gfx::FrameTime LayerTreeImpl::CurrentFrameTimeTicks() const { |
| 581 return layer_tree_host_impl_->CurrentFrameTimeTicks(); | 581 return layer_tree_host_impl_->CurrentFrameTimeTicks(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 base::Time LayerTreeImpl::CurrentFrameTime() const { | 584 base::Time LayerTreeImpl::CurrentFrameTime() const { |
| 585 return layer_tree_host_impl_->CurrentFrameTime(); | 585 return layer_tree_host_impl_->CurrentFrameTime(); |
| 586 } | 586 } |
| 587 | 587 |
| 588 base::TimeTicks LayerTreeImpl::CurrentPhysicalTimeTicks() const { | 588 gfx::FrameTime LayerTreeImpl::CurrentPhysicalFrameTime() const { |
| 589 return layer_tree_host_impl_->CurrentPhysicalTimeTicks(); | 589 return layer_tree_host_impl_->CurrentPhysicalFrameTime(); |
| 590 } | 590 } |
| 591 | 591 |
| 592 void LayerTreeImpl::SetNeedsCommit() { | 592 void LayerTreeImpl::SetNeedsCommit() { |
| 593 layer_tree_host_impl_->SetNeedsCommit(); | 593 layer_tree_host_impl_->SetNeedsCommit(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 gfx::Size LayerTreeImpl::DrawViewportSize() const { | 596 gfx::Size LayerTreeImpl::DrawViewportSize() const { |
| 597 return layer_tree_host_impl_->DrawViewportSize(); | 597 return layer_tree_host_impl_->DrawViewportSize(); |
| 598 } | 598 } |
| 599 | 599 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() | 761 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() |
| 762 const { | 762 const { |
| 763 // Only the active tree needs to know about layers with copy requests, as | 763 // Only the active tree needs to know about layers with copy requests, as |
| 764 // they are aborted if not serviced during draw. | 764 // they are aborted if not serviced during draw. |
| 765 DCHECK(IsActiveTree()); | 765 DCHECK(IsActiveTree()); |
| 766 | 766 |
| 767 return layers_with_copy_output_request_; | 767 return layers_with_copy_output_request_; |
| 768 } | 768 } |
| 769 | 769 |
| 770 } // namespace cc | 770 } // namespace cc |
| OLD | NEW |