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

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

Issue 2830473002: Revert of Remove UpdateScrollTree (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | 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 "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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 } else if (!can_render_to_separate_surface) { 736 } else if (!can_render_to_separate_surface) {
737 node->target_id = EffectTree::kContentsRootNodeId; 737 node->target_id = EffectTree::kContentsRootNodeId;
738 } else if (effect_tree->parent(node)->has_render_surface) { 738 } else if (effect_tree->parent(node)->has_render_surface) {
739 node->target_id = node->parent_id; 739 node->target_id = node->parent_id;
740 } else { 740 } else {
741 node->target_id = effect_tree->parent(node)->target_id; 741 node->target_id = effect_tree->parent(node)->target_id;
742 } 742 }
743 } 743 }
744 } 744 }
745 745
746 static void UpdateScrollTree(ScrollTree* scroll_tree,
747 const LayerTreeHost* layer_tree_host) {
748 if (!scroll_tree->needs_update())
749 return;
750
751 for (int i = ScrollTree::kRootNodeId;
752 i < static_cast<int>(scroll_tree->size()); ++i) {
753 ScrollNode* scroll_node = scroll_tree->Node(i);
754 if (Layer* scroll_layer =
755 layer_tree_host->LayerById(scroll_node->owning_layer_id)) {
756 if (Layer* scroll_clip_layer = scroll_layer->scroll_clip_layer()) {
757 scroll_node->scroll_clip_layer_bounds = scroll_clip_layer->bounds();
758 }
759 }
760 }
761 }
762
746 static void ComputeClips(PropertyTrees* property_trees) { 763 static void ComputeClips(PropertyTrees* property_trees) {
747 DCHECK(!property_trees->transform_tree.needs_update()); 764 DCHECK(!property_trees->transform_tree.needs_update());
748 ClipTree* clip_tree = &property_trees->clip_tree; 765 ClipTree* clip_tree = &property_trees->clip_tree;
749 if (!clip_tree->needs_update()) 766 if (!clip_tree->needs_update())
750 return; 767 return;
751 const int target_effect_id = EffectTree::kContentsRootNodeId; 768 const int target_effect_id = EffectTree::kContentsRootNodeId;
752 const int target_transform_id = TransformTree::kRootNodeId; 769 const int target_transform_id = TransformTree::kRootNodeId;
753 const bool include_expanding_clips = true; 770 const bool include_expanding_clips = true;
754 for (int i = ClipTree::kViewportNodeId; 771 for (int i = ClipTree::kViewportNodeId;
755 i < static_cast<int>(clip_tree->size()); ++i) { 772 i < static_cast<int>(clip_tree->size()); ++i) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 DCHECK_EQ(layer_tree_host->property_trees(), property_trees); 882 DCHECK_EQ(layer_tree_host->property_trees(), property_trees);
866 if (property_trees->non_root_surfaces_enabled != 883 if (property_trees->non_root_surfaces_enabled !=
867 can_render_to_separate_surface) { 884 can_render_to_separate_surface) {
868 property_trees->non_root_surfaces_enabled = can_render_to_separate_surface; 885 property_trees->non_root_surfaces_enabled = can_render_to_separate_surface;
869 property_trees->transform_tree.set_needs_update(true); 886 property_trees->transform_tree.set_needs_update(true);
870 } 887 }
871 if (property_trees->transform_tree.needs_update()) { 888 if (property_trees->transform_tree.needs_update()) {
872 property_trees->clip_tree.set_needs_update(true); 889 property_trees->clip_tree.set_needs_update(true);
873 property_trees->effect_tree.set_needs_update(true); 890 property_trees->effect_tree.set_needs_update(true);
874 } 891 }
892 UpdateScrollTree(&property_trees->scroll_tree, layer_tree_host);
875 ComputeTransforms(&property_trees->transform_tree); 893 ComputeTransforms(&property_trees->transform_tree);
876 ComputeEffects(&property_trees->effect_tree); 894 ComputeEffects(&property_trees->effect_tree);
877 // Computation of clips uses ToScreen which is updated while computing 895 // Computation of clips uses ToScreen which is updated while computing
878 // transforms. So, ComputeTransforms should be before ComputeClips. 896 // transforms. So, ComputeTransforms should be before ComputeClips.
879 ComputeClips(property_trees); 897 ComputeClips(property_trees);
880 } 898 }
881 899
882 void UpdatePropertyTreesAndRenderSurfaces(LayerImpl* root_layer, 900 void UpdatePropertyTreesAndRenderSurfaces(LayerImpl* root_layer,
883 PropertyTrees* property_trees, 901 PropertyTrees* property_trees,
884 bool can_render_to_separate_surface, 902 bool can_render_to_separate_surface,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1089 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1072 const Layer* overscroll_elasticity_layer, 1090 const Layer* overscroll_elasticity_layer,
1073 const gfx::Vector2dF& elastic_overscroll) { 1091 const gfx::Vector2dF& elastic_overscroll) {
1074 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1092 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1075 elastic_overscroll); 1093 elastic_overscroll);
1076 } 1094 }
1077 1095
1078 } // namespace draw_property_utils 1096 } // namespace draw_property_utils
1079 1097
1080 } // namespace cc 1098 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698