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

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

Issue 2623313003: Add map from element id to scroll node index. (Closed)
Patch Set: Created 3 years, 11 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 | cc/trees/layer_tree_host_unittest.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3924 matching lines...) Expand 10 before | Expand all | Expand 10 after
3935 layer->set_was_ever_ready_since_last_transform_animation(false); 3935 layer->set_was_ever_ready_since_last_transform_animation(false);
3936 } 3936 }
3937 3937
3938 void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated( 3938 void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated(
3939 ElementId element_id, 3939 ElementId element_id,
3940 LayerTreeImpl* tree, 3940 LayerTreeImpl* tree,
3941 const gfx::ScrollOffset& scroll_offset) { 3941 const gfx::ScrollOffset& scroll_offset) {
3942 if (!tree) 3942 if (!tree)
3943 return; 3943 return;
3944 3944
3945 const int layer_id = tree->LayerIdByElementId(element_id); 3945 const int layer_id = tree->LayerIdByElementId(element_id);
wkorman 2017/01/12 00:09:31 Even after this change this method still looks up
ajuma 2017/01/12 15:58:51 I think scrolling should ultimately look the same
3946 PropertyTrees* property_trees = tree->property_trees(); 3946 PropertyTrees* property_trees = tree->property_trees();
3947 DCHECK(property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::SCROLL, 3947 DCHECK(property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::SCROLL,
3948 layer_id)); 3948 layer_id));
3949 DCHECK_EQ( 3949 DCHECK_EQ(
3950 1u, property_trees->element_id_to_transform_node_index.count(element_id)); 3950 1u, property_trees->element_id_to_transform_node_index.count(element_id));
3951 int transform_node_index = 3951 int transform_node_index =
3952 property_trees->element_id_to_transform_node_index[element_id]; 3952 property_trees->element_id_to_transform_node_index[element_id];
3953 // TODO(wkorman): Build map from element id to scroll node in property tree 3953 DCHECK_EQ(1u,
3954 // builder and make use of it below. 3954 property_trees->element_id_to_scroll_node_index.count(element_id));
3955 const int scroll_node_index = 3955 const int scroll_node_index =
3956 property_trees->scroll_id_to_index_map[layer_id]; 3956 property_trees->element_id_to_scroll_node_index[element_id];
3957 if (scroll_node_index != ScrollTree::kInvalidNodeId) { 3957 property_trees->scroll_tree.OnScrollOffsetAnimated(
3958 property_trees->scroll_tree.OnScrollOffsetAnimated( 3958 layer_id, transform_node_index, scroll_node_index, scroll_offset, tree);
3959 layer_id, transform_node_index, scroll_node_index, scroll_offset, tree); 3959 // Run mutation callbacks to respond to updated scroll offset.
3960 // Run mutation callbacks to respond to updated scroll offset. 3960 Mutate(CurrentBeginFrameArgs().frame_time);
3961 Mutate(CurrentBeginFrameArgs().frame_time);
3962 }
3963 } 3961 }
3964 3962
3965 bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( 3963 bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment(
3966 const LayerImpl* layer) const { 3964 const LayerImpl* layer) const {
3967 return mutator_host_->AnimationsPreserveAxisAlignment(layer->element_id()); 3965 return mutator_host_->AnimationsPreserveAxisAlignment(layer->element_id());
3968 } 3966 }
3969 3967
3970 void LayerTreeHostImpl::SetNeedUpdateGpuRasterizationStatus() { 3968 void LayerTreeHostImpl::SetNeedUpdateGpuRasterizationStatus() {
3971 need_update_gpu_rasterization_status_ = true; 3969 need_update_gpu_rasterization_status_ = true;
3972 } 3970 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
4089 worker_context_visibility_ = 4087 worker_context_visibility_ =
4090 worker_context->CacheController()->ClientBecameVisible(); 4088 worker_context->CacheController()->ClientBecameVisible();
4091 } else { 4089 } else {
4092 worker_context->CacheController()->ClientBecameNotVisible( 4090 worker_context->CacheController()->ClientBecameNotVisible(
4093 std::move(worker_context_visibility_)); 4091 std::move(worker_context_visibility_));
4094 } 4092 }
4095 } 4093 }
4096 } 4094 }
4097 4095
4098 } // namespace cc 4096 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698