OLD | NEW |
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 3975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3986 return true; | 3986 return true; |
3987 | 3987 |
3988 return false; | 3988 return false; |
3989 } | 3989 } |
3990 } | 3990 } |
3991 | 3991 |
3992 void LayerTreeHostImpl::SetMutatorsNeedCommit() {} | 3992 void LayerTreeHostImpl::SetMutatorsNeedCommit() {} |
3993 | 3993 |
3994 void LayerTreeHostImpl::SetMutatorsNeedRebuildPropertyTrees() {} | 3994 void LayerTreeHostImpl::SetMutatorsNeedRebuildPropertyTrees() {} |
3995 | 3995 |
3996 void LayerTreeHostImpl::SetTreeLayerFilterMutated( | |
3997 ElementId element_id, | |
3998 LayerTreeImpl* tree, | |
3999 const FilterOperations& filters) { | |
4000 if (!tree) | |
4001 return; | |
4002 | |
4003 PropertyTrees* property_trees = tree->property_trees(); | |
4004 DCHECK_EQ(1u, | |
4005 property_trees->element_id_to_effect_node_index.count(element_id)); | |
4006 const int effect_node_index = | |
4007 property_trees->element_id_to_effect_node_index[element_id]; | |
4008 property_trees->effect_tree.OnFilterAnimated(filters, effect_node_index, | |
4009 tree); | |
4010 } | |
4011 | |
4012 void LayerTreeHostImpl::SetTreeLayerOpacityMutated(ElementId element_id, | |
4013 LayerTreeImpl* tree, | |
4014 float opacity) { | |
4015 if (!tree) | |
4016 return; | |
4017 | |
4018 PropertyTrees* property_trees = tree->property_trees(); | |
4019 DCHECK_EQ(1u, | |
4020 property_trees->element_id_to_effect_node_index.count(element_id)); | |
4021 const int effect_node_index = | |
4022 property_trees->element_id_to_effect_node_index[element_id]; | |
4023 property_trees->effect_tree.OnOpacityAnimated(opacity, effect_node_index, | |
4024 tree); | |
4025 } | |
4026 | |
4027 void LayerTreeHostImpl::SetTreeLayerTransformMutated( | |
4028 ElementId element_id, | |
4029 LayerTreeImpl* tree, | |
4030 const gfx::Transform& transform) { | |
4031 if (!tree) | |
4032 return; | |
4033 | |
4034 PropertyTrees* property_trees = tree->property_trees(); | |
4035 DCHECK_EQ( | |
4036 1u, property_trees->element_id_to_transform_node_index.count(element_id)); | |
4037 const int transform_node_index = | |
4038 property_trees->element_id_to_transform_node_index[element_id]; | |
4039 property_trees->transform_tree.OnTransformAnimated( | |
4040 transform, transform_node_index, tree); | |
4041 if (LayerImpl* layer = tree->LayerByElementId(element_id)) | |
4042 layer->set_was_ever_ready_since_last_transform_animation(false); | |
4043 } | |
4044 | |
4045 void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated( | 3996 void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated( |
4046 ElementId element_id, | 3997 ElementId element_id, |
4047 LayerTreeImpl* tree, | 3998 LayerTreeImpl* tree, |
4048 const gfx::ScrollOffset& scroll_offset) { | 3999 const gfx::ScrollOffset& scroll_offset) { |
4049 if (!tree) | 4000 if (!tree) |
4050 return; | 4001 return; |
4051 | 4002 |
4052 const int layer_id = tree->LayerIdByElementId(element_id); | 4003 const int layer_id = tree->LayerIdByElementId(element_id); |
4053 PropertyTrees* property_trees = tree->property_trees(); | 4004 PropertyTrees* property_trees = tree->property_trees(); |
4054 DCHECK_EQ(1u, | 4005 DCHECK_EQ(1u, |
(...skipping 13 matching lines...) Expand all Loading... |
4068 | 4019 |
4069 void LayerTreeHostImpl::SetNeedUpdateGpuRasterizationStatus() { | 4020 void LayerTreeHostImpl::SetNeedUpdateGpuRasterizationStatus() { |
4070 need_update_gpu_rasterization_status_ = true; | 4021 need_update_gpu_rasterization_status_ = true; |
4071 } | 4022 } |
4072 | 4023 |
4073 void LayerTreeHostImpl::SetElementFilterMutated( | 4024 void LayerTreeHostImpl::SetElementFilterMutated( |
4074 ElementId element_id, | 4025 ElementId element_id, |
4075 ElementListType list_type, | 4026 ElementListType list_type, |
4076 const FilterOperations& filters) { | 4027 const FilterOperations& filters) { |
4077 if (list_type == ElementListType::ACTIVE) { | 4028 if (list_type == ElementListType::ACTIVE) { |
4078 SetTreeLayerFilterMutated(element_id, active_tree(), filters); | 4029 active_tree()->SetTreeLayerFilterMutated(element_id, filters); |
4079 } else { | 4030 } else { |
4080 SetTreeLayerFilterMutated(element_id, pending_tree(), filters); | 4031 if (pending_tree()) |
4081 SetTreeLayerFilterMutated(element_id, recycle_tree(), filters); | 4032 pending_tree()->SetTreeLayerFilterMutated(element_id, filters); |
| 4033 if (recycle_tree()) |
| 4034 recycle_tree()->SetTreeLayerFilterMutated(element_id, filters); |
4082 } | 4035 } |
4083 } | 4036 } |
4084 | 4037 |
4085 void LayerTreeHostImpl::SetElementOpacityMutated(ElementId element_id, | 4038 void LayerTreeHostImpl::SetElementOpacityMutated(ElementId element_id, |
4086 ElementListType list_type, | 4039 ElementListType list_type, |
4087 float opacity) { | 4040 float opacity) { |
4088 if (list_type == ElementListType::ACTIVE) { | 4041 if (list_type == ElementListType::ACTIVE) { |
4089 SetTreeLayerOpacityMutated(element_id, active_tree(), opacity); | 4042 active_tree()->SetTreeLayerOpacityMutated(element_id, opacity); |
4090 } else { | 4043 } else { |
4091 SetTreeLayerOpacityMutated(element_id, pending_tree(), opacity); | 4044 if (pending_tree()) |
4092 SetTreeLayerOpacityMutated(element_id, recycle_tree(), opacity); | 4045 pending_tree()->SetTreeLayerOpacityMutated(element_id, opacity); |
| 4046 if (recycle_tree()) |
| 4047 recycle_tree()->SetTreeLayerOpacityMutated(element_id, opacity); |
4093 } | 4048 } |
4094 } | 4049 } |
4095 | 4050 |
4096 void LayerTreeHostImpl::SetElementTransformMutated( | 4051 void LayerTreeHostImpl::SetElementTransformMutated( |
4097 ElementId element_id, | 4052 ElementId element_id, |
4098 ElementListType list_type, | 4053 ElementListType list_type, |
4099 const gfx::Transform& transform) { | 4054 const gfx::Transform& transform) { |
4100 if (list_type == ElementListType::ACTIVE) { | 4055 if (list_type == ElementListType::ACTIVE) { |
4101 SetTreeLayerTransformMutated(element_id, active_tree(), transform); | 4056 active_tree()->SetTreeLayerTransformMutated(element_id, transform); |
4102 } else { | 4057 } else { |
4103 SetTreeLayerTransformMutated(element_id, pending_tree(), transform); | 4058 if (pending_tree()) |
4104 SetTreeLayerTransformMutated(element_id, recycle_tree(), transform); | 4059 pending_tree()->SetTreeLayerTransformMutated(element_id, transform); |
| 4060 if (recycle_tree()) |
| 4061 recycle_tree()->SetTreeLayerTransformMutated(element_id, transform); |
4105 } | 4062 } |
4106 } | 4063 } |
4107 | 4064 |
4108 void LayerTreeHostImpl::SetElementScrollOffsetMutated( | 4065 void LayerTreeHostImpl::SetElementScrollOffsetMutated( |
4109 ElementId element_id, | 4066 ElementId element_id, |
4110 ElementListType list_type, | 4067 ElementListType list_type, |
4111 const gfx::ScrollOffset& scroll_offset) { | 4068 const gfx::ScrollOffset& scroll_offset) { |
4112 if (list_type == ElementListType::ACTIVE) { | 4069 if (list_type == ElementListType::ACTIVE) { |
4113 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); | 4070 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); |
4114 } else { | 4071 } else { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4250 worker_context_visibility_ = | 4207 worker_context_visibility_ = |
4251 worker_context->CacheController()->ClientBecameVisible(); | 4208 worker_context->CacheController()->ClientBecameVisible(); |
4252 } else { | 4209 } else { |
4253 worker_context->CacheController()->ClientBecameNotVisible( | 4210 worker_context->CacheController()->ClientBecameNotVisible( |
4254 std::move(worker_context_visibility_)); | 4211 std::move(worker_context_visibility_)); |
4255 } | 4212 } |
4256 } | 4213 } |
4257 } | 4214 } |
4258 | 4215 |
4259 } // namespace cc | 4216 } // namespace cc |
OLD | NEW |