Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 23102003: Note scrollbar layer properties changed when position changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698