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

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

Issue 2349713002: [cc] Remove unused parameter to DidUpdateScrollOffset (Closed)
Patch Set: address reviewer comments. 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
« no previous file with comments | « cc/trees/layer_tree_impl.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 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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 const gfx::ScrollOffset& scroll_offset, 1315 const gfx::ScrollOffset& scroll_offset,
1316 LayerTreeImpl* layer_tree_impl) { 1316 LayerTreeImpl* layer_tree_impl) {
1317 // Only active tree needs to be updated, pending tree will find out about 1317 // Only active tree needs to be updated, pending tree will find out about
1318 // these changes as a result of the shared SyncedProperty. 1318 // these changes as a result of the shared SyncedProperty.
1319 if (!property_trees()->is_active) 1319 if (!property_trees()->is_active)
1320 return; 1320 return;
1321 1321
1322 ScrollNode* scroll_node = Node(scroll_tree_index); 1322 ScrollNode* scroll_node = Node(scroll_tree_index);
1323 if (SetScrollOffset(layer_id, 1323 if (SetScrollOffset(layer_id,
1324 ClampScrollOffsetToLimits(scroll_offset, scroll_node))) 1324 ClampScrollOffsetToLimits(scroll_offset, scroll_node)))
1325 layer_tree_impl->DidUpdateScrollOffset(layer_id, transform_tree_index); 1325 layer_tree_impl->DidUpdateScrollOffset(layer_id);
1326 layer_tree_impl->DidAnimateScrollOffset(); 1326 layer_tree_impl->DidAnimateScrollOffset();
1327 } 1327 }
1328 1328
1329 gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const { 1329 gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const {
1330 const ScrollNode* scroll_node = Node(scroll_node_id); 1330 const ScrollNode* scroll_node = Node(scroll_node_id);
1331 gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds; 1331 gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds;
1332 1332
1333 gfx::Vector2dF scroll_clip_layer_bounds_delta; 1333 gfx::Vector2dF scroll_clip_layer_bounds_delta;
1334 if (scroll_node->is_inner_viewport_scroll_layer) { 1334 if (scroll_node->is_inner_viewport_scroll_layer) {
1335 scroll_clip_layer_bounds_delta.Add( 1335 scroll_clip_layer_bounds_delta.Add(
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 // instance of synced scroll offset; if we are pushing from pending to active, 1463 // instance of synced scroll offset; if we are pushing from pending to active,
1464 // we reuse the pending tree's value in the map. 1464 // we reuse the pending tree's value in the map.
1465 if (!property_trees()->is_active) { 1465 if (!property_trees()->is_active) {
1466 changed = synced_scroll_offset(key)->PushFromMainThread( 1466 changed = synced_scroll_offset(key)->PushFromMainThread(
1467 new_scroll_offset_map->at(key)->PendingBase()); 1467 new_scroll_offset_map->at(key)->PendingBase());
1468 1468
1469 if (new_scroll_offset_map->at(key)->clobber_active_value()) { 1469 if (new_scroll_offset_map->at(key)->clobber_active_value()) {
1470 synced_scroll_offset(key)->set_clobber_active_value(); 1470 synced_scroll_offset(key)->set_clobber_active_value();
1471 } 1471 }
1472 if (changed) { 1472 if (changed) {
1473 layer_tree_impl->DidUpdateScrollOffset(key, kInvalidNodeId); 1473 layer_tree_impl->DidUpdateScrollOffset(key);
1474 } 1474 }
1475 } else { 1475 } else {
1476 layer_id_to_scroll_offset_map_[key] = new_scroll_offset_map->at(key); 1476 layer_id_to_scroll_offset_map_[key] = new_scroll_offset_map->at(key);
1477 changed |= synced_scroll_offset(key)->PushPendingToActive(); 1477 changed |= synced_scroll_offset(key)->PushPendingToActive();
1478 if (changed) { 1478 if (changed) {
1479 layer_tree_impl->DidUpdateScrollOffset(key, kInvalidNodeId); 1479 layer_tree_impl->DidUpdateScrollOffset(key);
1480 } 1480 }
1481 } 1481 }
1482 } 1482 }
1483 1483
1484 void ScrollTree::UpdateScrollOffsetMap( 1484 void ScrollTree::UpdateScrollOffsetMap(
1485 ScrollTree::ScrollOffsetMap* new_scroll_offset_map, 1485 ScrollTree::ScrollOffsetMap* new_scroll_offset_map,
1486 LayerTreeImpl* layer_tree_impl) { 1486 LayerTreeImpl* layer_tree_impl) {
1487 if (layer_tree_impl && !layer_tree_impl->LayerListIsEmpty()) { 1487 if (layer_tree_impl && !layer_tree_impl->LayerListIsEmpty()) {
1488 DCHECK(!property_trees()->is_main_thread); 1488 DCHECK(!property_trees()->is_main_thread);
1489 for (auto map_entry = layer_id_to_scroll_offset_map_.begin(); 1489 for (auto map_entry = layer_id_to_scroll_offset_map_.begin();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 gfx::ScrollOffset adjusted_scroll(scroll); 1597 gfx::ScrollOffset adjusted_scroll(scroll);
1598 if (!scroll_node->user_scrollable_horizontal) 1598 if (!scroll_node->user_scrollable_horizontal)
1599 adjusted_scroll.set_x(0); 1599 adjusted_scroll.set_x(0);
1600 if (!scroll_node->user_scrollable_vertical) 1600 if (!scroll_node->user_scrollable_vertical)
1601 adjusted_scroll.set_y(0); 1601 adjusted_scroll.set_y(0);
1602 DCHECK(scroll_node->scrollable); 1602 DCHECK(scroll_node->scrollable);
1603 gfx::ScrollOffset old_offset = current_scroll_offset(scroll_node->owner_id); 1603 gfx::ScrollOffset old_offset = current_scroll_offset(scroll_node->owner_id);
1604 gfx::ScrollOffset new_offset = 1604 gfx::ScrollOffset new_offset =
1605 ClampScrollOffsetToLimits(old_offset + adjusted_scroll, scroll_node); 1605 ClampScrollOffsetToLimits(old_offset + adjusted_scroll, scroll_node);
1606 if (SetScrollOffset(scroll_node->owner_id, new_offset)) 1606 if (SetScrollOffset(scroll_node->owner_id, new_offset))
1607 layer_tree_impl->DidUpdateScrollOffset(scroll_node->owner_id, 1607 layer_tree_impl->DidUpdateScrollOffset(scroll_node->owner_id);
1608 scroll_node->transform_id);
1609 1608
1610 gfx::ScrollOffset unscrolled = 1609 gfx::ScrollOffset unscrolled =
1611 old_offset + gfx::ScrollOffset(scroll) - new_offset; 1610 old_offset + gfx::ScrollOffset(scroll) - new_offset;
1612 return gfx::Vector2dF(unscrolled.x(), unscrolled.y()); 1611 return gfx::Vector2dF(unscrolled.x(), unscrolled.y());
1613 } 1612 }
1614 1613
1615 gfx::ScrollOffset ScrollTree::ClampScrollOffsetToLimits( 1614 gfx::ScrollOffset ScrollTree::ClampScrollOffsetToLimits(
1616 gfx::ScrollOffset offset, 1615 gfx::ScrollOffset offset,
1617 ScrollNode* scroll_node) const { 1616 ScrollNode* scroll_node) const {
1618 offset.SetToMin(MaxScrollOffset(scroll_node->id)); 1617 offset.SetToMin(MaxScrollOffset(scroll_node->id));
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 from_target.ConcatTransform(draw_transforms.from_target); 2247 from_target.ConcatTransform(draw_transforms.from_target);
2249 from_target.Scale(effect_node->surface_contents_scale.x(), 2248 from_target.Scale(effect_node->surface_contents_scale.x(),
2250 effect_node->surface_contents_scale.y()); 2249 effect_node->surface_contents_scale.y());
2251 DCHECK(from_target.ApproximatelyEqual(*transform) || 2250 DCHECK(from_target.ApproximatelyEqual(*transform) ||
2252 !draw_transforms.invertible); 2251 !draw_transforms.invertible);
2253 } 2252 }
2254 return success; 2253 return success;
2255 } 2254 }
2256 2255
2257 } // namespace cc 2256 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698