| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 DCHECK(IsActiveTree()); | 252 DCHECK(IsActiveTree()); |
| 253 | 253 |
| 254 gfx::RectF scrollable_viewport( | 254 gfx::RectF scrollable_viewport( |
| 255 gfx::PointAtOffsetFromOrigin(root_scroll->TotalScrollOffset()), | 255 gfx::PointAtOffsetFromOrigin(root_scroll->TotalScrollOffset()), |
| 256 ScrollableViewportSize()); | 256 ScrollableViewportSize()); |
| 257 float vertical_adjust = 0.0f; | 257 float vertical_adjust = 0.0f; |
| 258 if (RootContainerLayer()) | 258 if (RootContainerLayer()) |
| 259 vertical_adjust = layer_tree_host_impl_->VisibleViewportSize().height() - | 259 vertical_adjust = layer_tree_host_impl_->VisibleViewportSize().height() - |
| 260 RootContainerLayer()->bounds().height(); | 260 RootContainerLayer()->bounds().height(); |
| 261 if (ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer()) { | 261 if (ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer()) { |
| 262 horiz->set_vertical_adjust(vertical_adjust); | 262 horiz->SetVerticalAdjust(vertical_adjust); |
| 263 horiz->set_visible_to_total_length_ratio( | 263 horiz->SetVisibleToTotalLengthRatio( |
| 264 scrollable_viewport.width() / ScrollableSize().width()); | 264 scrollable_viewport.width() / ScrollableSize().width()); |
| 265 } | 265 } |
| 266 if (ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer()) { | 266 if (ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer()) { |
| 267 vertical->set_vertical_adjust(vertical_adjust); | 267 vertical->SetVerticalAdjust(vertical_adjust); |
| 268 vertical->set_visible_to_total_length_ratio( | 268 vertical->SetVisibleToTotalLengthRatio( |
| 269 scrollable_viewport.height() / ScrollableSize().height()); | 269 scrollable_viewport.height() / ScrollableSize().height()); |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 | 272 |
| 273 void LayerTreeImpl::UpdateDrawProperties() { | 273 void LayerTreeImpl::UpdateDrawProperties() { |
| 274 if (IsActiveTree() && RootScrollLayer() && RootContainerLayer()) | 274 if (IsActiveTree() && RootScrollLayer() && RootContainerLayer()) |
| 275 UpdateRootScrollLayerSizeDelta(); | 275 UpdateRootScrollLayerSizeDelta(); |
| 276 | 276 |
| 277 if (settings().solid_color_scrollbars && | 277 if (settings().solid_color_scrollbars && |
| 278 IsActiveTree() && | 278 IsActiveTree() && |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() | 631 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() |
| 632 const { | 632 const { |
| 633 // Only the active tree needs to know about layers with copy requests, as | 633 // Only the active tree needs to know about layers with copy requests, as |
| 634 // they are aborted if not serviced during draw. | 634 // they are aborted if not serviced during draw. |
| 635 DCHECK(IsActiveTree()); | 635 DCHECK(IsActiveTree()); |
| 636 | 636 |
| 637 return layers_with_copy_output_request_; | 637 return layers_with_copy_output_request_; |
| 638 } | 638 } |
| 639 | 639 |
| 640 } // namespace cc | 640 } // namespace cc |
| OLD | NEW |