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

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

Issue 2616353003: Clarify property tree id-to-index map names. (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
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 3880 matching lines...) Expand 10 before | Expand all | Expand 10 after
3891 ElementId element_id, 3891 ElementId element_id,
3892 LayerTreeImpl* tree, 3892 LayerTreeImpl* tree,
3893 const FilterOperations& filters) { 3893 const FilterOperations& filters) {
3894 if (!tree) 3894 if (!tree)
3895 return; 3895 return;
3896 3896
3897 const int layer_id = tree->LayerIdByElementId(element_id); 3897 const int layer_id = tree->LayerIdByElementId(element_id);
3898 DCHECK(tree->property_trees()->IsInIdToIndexMap( 3898 DCHECK(tree->property_trees()->IsInIdToIndexMap(
3899 PropertyTrees::TreeType::EFFECT, layer_id)); 3899 PropertyTrees::TreeType::EFFECT, layer_id));
3900 const int effect_id = 3900 const int effect_id =
3901 tree->property_trees()->effect_id_to_index_map[layer_id]; 3901 tree->property_trees()->layer_id_to_effect_node_index[layer_id];
3902 if (effect_id != EffectTree::kInvalidNodeId) 3902 if (effect_id != EffectTree::kInvalidNodeId)
3903 tree->property_trees()->effect_tree.OnFilterAnimated(filters, effect_id, 3903 tree->property_trees()->effect_tree.OnFilterAnimated(filters, effect_id,
3904 tree); 3904 tree);
3905 } 3905 }
3906 3906
3907 void LayerTreeHostImpl::SetTreeLayerOpacityMutated(ElementId element_id, 3907 void LayerTreeHostImpl::SetTreeLayerOpacityMutated(ElementId element_id,
3908 LayerTreeImpl* tree, 3908 LayerTreeImpl* tree,
3909 float opacity) { 3909 float opacity) {
3910 if (!tree) 3910 if (!tree)
3911 return; 3911 return;
3912 3912
3913 const int layer_id = tree->LayerIdByElementId(element_id); 3913 const int layer_id = tree->LayerIdByElementId(element_id);
3914 DCHECK(tree->property_trees()->IsInIdToIndexMap( 3914 DCHECK(tree->property_trees()->IsInIdToIndexMap(
3915 PropertyTrees::TreeType::EFFECT, layer_id)); 3915 PropertyTrees::TreeType::EFFECT, layer_id));
3916 const int effect_id = 3916 const int effect_id =
3917 tree->property_trees()->effect_id_to_index_map[layer_id]; 3917 tree->property_trees()->layer_id_to_effect_node_index[layer_id];
3918 if (effect_id != EffectTree::kInvalidNodeId) 3918 if (effect_id != EffectTree::kInvalidNodeId)
3919 tree->property_trees()->effect_tree.OnOpacityAnimated(opacity, effect_id, 3919 tree->property_trees()->effect_tree.OnOpacityAnimated(opacity, effect_id,
3920 tree); 3920 tree);
3921 } 3921 }
3922 3922
3923 void LayerTreeHostImpl::SetTreeLayerTransformMutated( 3923 void LayerTreeHostImpl::SetTreeLayerTransformMutated(
3924 ElementId element_id, 3924 ElementId element_id,
3925 LayerTreeImpl* tree, 3925 LayerTreeImpl* tree,
3926 const gfx::Transform& transform) { 3926 const gfx::Transform& transform) {
3927 if (!tree) 3927 if (!tree)
3928 return; 3928 return;
3929 3929
3930 const int layer_id = tree->LayerIdByElementId(element_id); 3930 const int layer_id = tree->LayerIdByElementId(element_id);
3931 DCHECK(tree->property_trees()->IsInIdToIndexMap( 3931 DCHECK(tree->property_trees()->IsInIdToIndexMap(
3932 PropertyTrees::TreeType::TRANSFORM, layer_id)); 3932 PropertyTrees::TreeType::TRANSFORM, layer_id));
3933 const int transform_id = 3933 const int transform_id =
3934 tree->property_trees()->transform_id_to_index_map[layer_id]; 3934 tree->property_trees()->layer_id_to_transform_node_index[layer_id];
3935 if (transform_id != TransformTree::kInvalidNodeId) 3935 if (transform_id != TransformTree::kInvalidNodeId)
3936 tree->property_trees()->transform_tree.OnTransformAnimated( 3936 tree->property_trees()->transform_tree.OnTransformAnimated(
3937 transform, transform_id, tree); 3937 transform, transform_id, tree);
3938 LayerImpl* layer = tree->LayerById(layer_id); 3938 LayerImpl* layer = tree->LayerById(layer_id);
3939 if (layer) 3939 if (layer)
3940 layer->set_was_ever_ready_since_last_transform_animation(false); 3940 layer->set_was_ever_ready_since_last_transform_animation(false);
3941 } 3941 }
3942 3942
3943 void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated( 3943 void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated(
3944 ElementId element_id, 3944 ElementId element_id,
3945 LayerTreeImpl* tree, 3945 LayerTreeImpl* tree,
3946 const gfx::ScrollOffset& scroll_offset) { 3946 const gfx::ScrollOffset& scroll_offset) {
3947 if (!tree) 3947 if (!tree)
3948 return; 3948 return;
3949 3949
3950 const int layer_id = tree->LayerIdByElementId(element_id); 3950 const int layer_id = tree->LayerIdByElementId(element_id);
3951 DCHECK(tree->property_trees()->IsInIdToIndexMap( 3951 DCHECK(tree->property_trees()->IsInIdToIndexMap(
3952 PropertyTrees::TreeType::TRANSFORM, layer_id)); 3952 PropertyTrees::TreeType::TRANSFORM, layer_id));
3953 DCHECK(tree->property_trees()->IsInIdToIndexMap( 3953 DCHECK(tree->property_trees()->IsInIdToIndexMap(
3954 PropertyTrees::TreeType::SCROLL, layer_id)); 3954 PropertyTrees::TreeType::SCROLL, layer_id));
3955 const int transform_id = 3955 const int transform_id =
3956 tree->property_trees()->transform_id_to_index_map[layer_id]; 3956 tree->property_trees()->layer_id_to_transform_node_index[layer_id];
3957 const int scroll_id = 3957 const int scroll_id =
3958 tree->property_trees()->scroll_id_to_index_map[layer_id]; 3958 tree->property_trees()->layer_id_to_scroll_node_index[layer_id];
3959 if (transform_id != TransformTree::kInvalidNodeId && 3959 if (transform_id != TransformTree::kInvalidNodeId &&
3960 scroll_id != ScrollTree::kInvalidNodeId) { 3960 scroll_id != ScrollTree::kInvalidNodeId) {
3961 tree->property_trees()->scroll_tree.OnScrollOffsetAnimated( 3961 tree->property_trees()->scroll_tree.OnScrollOffsetAnimated(
3962 layer_id, transform_id, scroll_id, scroll_offset, tree); 3962 layer_id, transform_id, scroll_id, scroll_offset, tree);
3963 // Run mutation callbacks to respond to updated scroll offset. 3963 // Run mutation callbacks to respond to updated scroll offset.
3964 Mutate(CurrentBeginFrameArgs().frame_time); 3964 Mutate(CurrentBeginFrameArgs().frame_time);
3965 } 3965 }
3966 } 3966 }
3967 3967
3968 bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( 3968 bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment(
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
4092 worker_context_visibility_ = 4092 worker_context_visibility_ =
4093 worker_context->CacheController()->ClientBecameVisible(); 4093 worker_context->CacheController()->ClientBecameVisible();
4094 } else { 4094 } else {
4095 worker_context->CacheController()->ClientBecameNotVisible( 4095 worker_context->CacheController()->ClientBecameNotVisible(
4096 std::move(worker_context_visibility_)); 4096 std::move(worker_context_visibility_));
4097 } 4097 }
4098 } 4098 }
4099 } 4099 }
4100 4100
4101 } // namespace cc 4101 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698