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

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

Issue 2714713003: Rename cc::ScrollNode's inner and outer viewport members (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 } 1202 }
1203 DCHECK(tree == *this); 1203 DCHECK(tree == *this);
1204 #endif 1204 #endif
1205 } 1205 }
1206 1206
1207 gfx::ScrollOffset ScrollTree::MaxScrollOffset(int scroll_node_id) const { 1207 gfx::ScrollOffset ScrollTree::MaxScrollOffset(int scroll_node_id) const {
1208 const ScrollNode* scroll_node = Node(scroll_node_id); 1208 const ScrollNode* scroll_node = Node(scroll_node_id);
1209 gfx::SizeF scroll_bounds = 1209 gfx::SizeF scroll_bounds =
1210 gfx::SizeF(scroll_node->bounds.width(), scroll_node->bounds.height()); 1210 gfx::SizeF(scroll_node->bounds.width(), scroll_node->bounds.height());
1211 1211
1212 if (scroll_node->is_inner_viewport_scroll_layer) { 1212 if (scroll_node->scrolls_inner_viewport) {
1213 scroll_bounds.Enlarge( 1213 scroll_bounds.Enlarge(
1214 property_trees()->inner_viewport_scroll_bounds_delta().x(), 1214 property_trees()->inner_viewport_scroll_bounds_delta().x(),
1215 property_trees()->inner_viewport_scroll_bounds_delta().y()); 1215 property_trees()->inner_viewport_scroll_bounds_delta().y());
1216 } 1216 }
1217 1217
1218 if (!scroll_node->scrollable || scroll_bounds.IsEmpty()) 1218 if (!scroll_node->scrollable || scroll_bounds.IsEmpty())
1219 return gfx::ScrollOffset(); 1219 return gfx::ScrollOffset();
1220 1220
1221 TransformTree& transform_tree = property_trees()->transform_tree; 1221 TransformTree& transform_tree = property_trees()->transform_tree;
1222 float scale_factor = 1.f; 1222 float scale_factor = 1.f;
(...skipping 29 matching lines...) Expand all
1252 ClampScrollOffsetToLimits(scroll_offset, scroll_node))) 1252 ClampScrollOffsetToLimits(scroll_offset, scroll_node)))
1253 layer_tree_impl->DidUpdateScrollOffset(layer_id); 1253 layer_tree_impl->DidUpdateScrollOffset(layer_id);
1254 layer_tree_impl->DidAnimateScrollOffset(); 1254 layer_tree_impl->DidAnimateScrollOffset();
1255 } 1255 }
1256 1256
1257 gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const { 1257 gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const {
1258 const ScrollNode* scroll_node = Node(scroll_node_id); 1258 const ScrollNode* scroll_node = Node(scroll_node_id);
1259 gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds; 1259 gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds;
1260 1260
1261 gfx::Vector2dF scroll_clip_layer_bounds_delta; 1261 gfx::Vector2dF scroll_clip_layer_bounds_delta;
1262 if (scroll_node->is_inner_viewport_scroll_layer) { 1262 if (scroll_node->scrolls_inner_viewport) {
1263 scroll_clip_layer_bounds_delta.Add( 1263 scroll_clip_layer_bounds_delta.Add(
1264 property_trees()->inner_viewport_container_bounds_delta()); 1264 property_trees()->inner_viewport_container_bounds_delta());
1265 } else if (scroll_node->is_outer_viewport_scroll_layer) { 1265 } else if (scroll_node->scrolls_outer_viewport) {
1266 scroll_clip_layer_bounds_delta.Add( 1266 scroll_clip_layer_bounds_delta.Add(
1267 property_trees()->outer_viewport_container_bounds_delta()); 1267 property_trees()->outer_viewport_container_bounds_delta());
1268 } 1268 }
1269 1269
1270 gfx::Vector2d delta = gfx::ToCeiledVector2d(scroll_clip_layer_bounds_delta); 1270 gfx::Vector2d delta = gfx::ToCeiledVector2d(scroll_clip_layer_bounds_delta);
1271 scroll_clip_layer_bounds.SetSize( 1271 scroll_clip_layer_bounds.SetSize(
1272 scroll_clip_layer_bounds.width() + delta.x(), 1272 scroll_clip_layer_bounds.width() + delta.x(),
1273 scroll_clip_layer_bounds.height() + delta.y()); 1273 scroll_clip_layer_bounds.height() + delta.y());
1274 1274
1275 return scroll_clip_layer_bounds; 1275 return scroll_clip_layer_bounds;
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 2130
2131 const EffectNode* effect_node = effect_tree.Node(effect_id); 2131 const EffectNode* effect_node = effect_tree.Node(effect_id);
2132 2132
2133 bool success = GetFromTarget(transform_id, effect_id, transform); 2133 bool success = GetFromTarget(transform_id, effect_id, transform);
2134 transform->Scale(effect_node->surface_contents_scale.x(), 2134 transform->Scale(effect_node->surface_contents_scale.x(),
2135 effect_node->surface_contents_scale.y()); 2135 effect_node->surface_contents_scale.y());
2136 return success; 2136 return success;
2137 } 2137 }
2138 2138
2139 } // namespace cc 2139 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698