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

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

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 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
« no previous file with comments | « cc/test/test_layer_tree_host_base.cc ('k') | cc/trees/layer_tree_host.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 "cc/trees/draw_property_utils.h" 5 #include "cc/trees/draw_property_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 page_scale_factor, device_scale_factor, 1552 page_scale_factor, device_scale_factor,
1553 device_transform); 1553 device_transform);
1554 } 1554 }
1555 1555
1556 template <typename LayerType> 1556 template <typename LayerType>
1557 static void UpdateElasticOverscrollInternal( 1557 static void UpdateElasticOverscrollInternal(
1558 PropertyTrees* property_trees, 1558 PropertyTrees* property_trees,
1559 const LayerType* overscroll_elasticity_layer, 1559 const LayerType* overscroll_elasticity_layer,
1560 const gfx::Vector2dF& elastic_overscroll) { 1560 const gfx::Vector2dF& elastic_overscroll) {
1561 if (!overscroll_elasticity_layer) { 1561 if (!overscroll_elasticity_layer) {
1562 DCHECK(elastic_overscroll.IsZero()); 1562 // When only the viewport has elasticity, elastic_overscroll should be zero
1563 // here, but for now elasticity doesn't bubble up, only down. So, that won't
1564 // be the case if a sublayer has its own overscroll.
1565 // TODO(tapted): Give the viewport overscroll and completely remove
1566 // overscroll_elasticity_layer.
1563 return; 1567 return;
1564 } 1568 }
1565 1569
1566 TransformNode* node = property_trees->transform_tree.Node( 1570 TransformNode* node = property_trees->transform_tree.Node(
1567 overscroll_elasticity_layer->transform_tree_index()); 1571 overscroll_elasticity_layer->transform_tree_index());
1568 if (node->scroll_offset == gfx::ScrollOffset(elastic_overscroll)) 1572 if (node->scroll_offset_with_overscroll ==
1573 gfx::ScrollOffset(elastic_overscroll))
1569 return; 1574 return;
1570 1575
1571 node->scroll_offset = gfx::ScrollOffset(elastic_overscroll); 1576 node->scroll_offset_with_overscroll = gfx::ScrollOffset(elastic_overscroll);
1572 node->needs_local_transform_update = true; 1577 node->needs_local_transform_update = true;
1573 property_trees->transform_tree.set_needs_update(true); 1578 property_trees->transform_tree.set_needs_update(true);
1574 } 1579 }
1575 1580
1576 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1581 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1577 const LayerImpl* overscroll_elasticity_layer, 1582 const LayerImpl* overscroll_elasticity_layer,
1578 const gfx::Vector2dF& elastic_overscroll) { 1583 const gfx::Vector2dF& elastic_overscroll) {
1579 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1584 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1580 elastic_overscroll); 1585 elastic_overscroll);
1581 } 1586 }
1582 1587
1583 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1588 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1584 const Layer* overscroll_elasticity_layer, 1589 const Layer* overscroll_elasticity_layer,
1585 const gfx::Vector2dF& elastic_overscroll) { 1590 const gfx::Vector2dF& elastic_overscroll) {
1586 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1591 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1587 elastic_overscroll); 1592 elastic_overscroll);
1588 } 1593 }
1589 1594
1590 } // namespace draw_property_utils 1595 } // namespace draw_property_utils
1591 1596
1592 } // namespace cc 1597 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_layer_tree_host_base.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698