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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 2365793002: Fix scroll chaining for non-descendants of root scroller. (Closed)
Patch Set: Fix tests Created 4 years, 3 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 void LayerImpl::SetDebugInfo( 118 void LayerImpl::SetDebugInfo(
119 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info) { 119 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info) {
120 owned_debug_info_ = std::move(debug_info); 120 owned_debug_info_ = std::move(debug_info);
121 debug_info_ = owned_debug_info_.get(); 121 debug_info_ = owned_debug_info_.get();
122 SetNeedsPushProperties(); 122 SetNeedsPushProperties();
123 } 123 }
124 124
125 void LayerImpl::DistributeScroll(ScrollState* scroll_state) { 125 void LayerImpl::DistributeScroll(ScrollState* scroll_state) {
126 ScrollTree& scroll_tree = layer_tree_impl()->property_trees()->scroll_tree; 126 ScrollTree& scroll_tree = layer_tree_impl()->property_trees()->scroll_tree;
127 ScrollNode* scroll_node = scroll_tree.Node(scroll_tree_index()); 127 ScrollNode* scroll_node = scroll_tree.Node(scroll_tree_index());
128 return scroll_tree.DistributeScroll(scroll_node, scroll_state); 128 scroll_tree.DistributeScroll(scroll_node, scroll_state);
129 }
130
131 void LayerImpl::ApplyScroll(ScrollState* scroll_state) {
132 DCHECK(scroll_state);
133 ScrollNode* node = layer_tree_impl()->property_trees()->scroll_tree.Node(
134 scroll_tree_index());
135 layer_tree_impl()->ApplyScroll(node, scroll_state);
136 } 129 }
137 130
138 void LayerImpl::SetTransformTreeIndex(int index) { 131 void LayerImpl::SetTransformTreeIndex(int index) {
139 transform_tree_index_ = index; 132 transform_tree_index_ = index;
140 } 133 }
141 134
142 void LayerImpl::SetClipTreeIndex(int index) { 135 void LayerImpl::SetClipTreeIndex(int index) {
143 clip_tree_index_ = index; 136 clip_tree_index_ = index;
144 } 137 }
145 138
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 .layer_transforms_should_scale_layer_contents) { 1100 .layer_transforms_should_scale_layer_contents) {
1108 return default_scale; 1101 return default_scale;
1109 } 1102 }
1110 1103
1111 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1104 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1112 ScreenSpaceTransform(), default_scale); 1105 ScreenSpaceTransform(), default_scale);
1113 return std::max(transform_scales.x(), transform_scales.y()); 1106 return std::max(transform_scales.x(), transform_scales.y());
1114 } 1107 }
1115 1108
1116 } // namespace cc 1109 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698