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

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

Issue 2822603002: 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
763 static void ComputeClips(PropertyTrees* property_trees) { 746 static void ComputeClips(PropertyTrees* property_trees) {
764 DCHECK(!property_trees->transform_tree.needs_update()); 747 DCHECK(!property_trees->transform_tree.needs_update());
765 ClipTree* clip_tree = &property_trees->clip_tree; 748 ClipTree* clip_tree = &property_trees->clip_tree;
766 if (!clip_tree->needs_update()) 749 if (!clip_tree->needs_update())
767 return; 750 return;
768 const int target_effect_id = EffectTree::kContentsRootNodeId; 751 const int target_effect_id = EffectTree::kContentsRootNodeId;
769 const int target_transform_id = TransformTree::kRootNodeId; 752 const int target_transform_id = TransformTree::kRootNodeId;
770 const bool include_expanding_clips = true; 753 const bool include_expanding_clips = true;
771 for (int i = ClipTree::kViewportNodeId; 754 for (int i = ClipTree::kViewportNodeId;
772 i < static_cast<int>(clip_tree->size()); ++i) { 755 i < static_cast<int>(clip_tree->size()); ++i) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 DCHECK_EQ(layer_tree_host->property_trees(), property_trees); 865 DCHECK_EQ(layer_tree_host->property_trees(), property_trees);
883 if (property_trees->non_root_surfaces_enabled != 866 if (property_trees->non_root_surfaces_enabled !=
884 can_render_to_separate_surface) { 867 can_render_to_separate_surface) {
885 property_trees->non_root_surfaces_enabled = can_render_to_separate_surface; 868 property_trees->non_root_surfaces_enabled = can_render_to_separate_surface;
886 property_trees->transform_tree.set_needs_update(true); 869 property_trees->transform_tree.set_needs_update(true);
887 } 870 }
888 if (property_trees->transform_tree.needs_update()) { 871 if (property_trees->transform_tree.needs_update()) {
889 property_trees->clip_tree.set_needs_update(true); 872 property_trees->clip_tree.set_needs_update(true);
890 property_trees->effect_tree.set_needs_update(true); 873 property_trees->effect_tree.set_needs_update(true);
891 } 874 }
892 UpdateScrollTree(&property_trees->scroll_tree, layer_tree_host);
893 ComputeTransforms(&property_trees->transform_tree); 875 ComputeTransforms(&property_trees->transform_tree);
894 ComputeEffects(&property_trees->effect_tree); 876 ComputeEffects(&property_trees->effect_tree);
895 // Computation of clips uses ToScreen which is updated while computing 877 // Computation of clips uses ToScreen which is updated while computing
896 // transforms. So, ComputeTransforms should be before ComputeClips. 878 // transforms. So, ComputeTransforms should be before ComputeClips.
897 ComputeClips(property_trees); 879 ComputeClips(property_trees);
898 } 880 }
899 881
900 void UpdatePropertyTreesAndRenderSurfaces(LayerImpl* root_layer, 882 void UpdatePropertyTreesAndRenderSurfaces(LayerImpl* root_layer,
901 PropertyTrees* property_trees, 883 PropertyTrees* property_trees,
902 bool can_render_to_separate_surface, 884 bool can_render_to_separate_surface,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1071 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1090 const Layer* overscroll_elasticity_layer, 1072 const Layer* overscroll_elasticity_layer,
1091 const gfx::Vector2dF& elastic_overscroll) { 1073 const gfx::Vector2dF& elastic_overscroll) {
1092 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1074 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1093 elastic_overscroll); 1075 elastic_overscroll);
1094 } 1076 }
1095 1077
1096 } // namespace draw_property_utils 1078 } // namespace draw_property_utils
1097 1079
1098 } // namespace cc 1080 } // 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