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 4031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4042 ElementListType list_type, | 4042 ElementListType list_type, |
4043 const gfx::ScrollOffset& scroll_offset) { | 4043 const gfx::ScrollOffset& scroll_offset) { |
4044 if (list_type == ElementListType::ACTIVE) { | 4044 if (list_type == ElementListType::ACTIVE) { |
4045 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); | 4045 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); |
4046 } else { | 4046 } else { |
4047 SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset); | 4047 SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset); |
4048 SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset); | 4048 SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset); |
4049 } | 4049 } |
4050 } | 4050 } |
4051 | 4051 |
4052 void LayerTreeHostImpl::ElementTransformIsAnimatingChanged( | 4052 void LayerTreeHostImpl::ElementIsAnimatingChanged( |
4053 ElementId element_id, | 4053 ElementId element_id, |
4054 ElementListType list_type, | 4054 ElementListType list_type, |
4055 AnimationChangeType change_type, | 4055 const PropertyAnimationState& mask, |
4056 bool is_animating) { | 4056 const PropertyAnimationState& state) { |
4057 LayerTreeImpl* tree = | 4057 LayerTreeImpl* tree = |
4058 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); | 4058 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); |
4059 if (!tree) | 4059 if (!tree) |
4060 return; | 4060 return; |
4061 LayerImpl* layer = tree->LayerByElementId(element_id); | 4061 LayerImpl* layer = tree->LayerByElementId(element_id); |
4062 if (layer) { | 4062 if (layer) |
4063 switch (change_type) { | 4063 layer->OnIsAnimatingChanged(mask, state); |
4064 case AnimationChangeType::POTENTIAL: | |
4065 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); | |
4066 break; | |
4067 case AnimationChangeType::RUNNING: | |
4068 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); | |
4069 break; | |
4070 case AnimationChangeType::BOTH: | |
4071 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); | |
4072 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); | |
4073 break; | |
4074 } | |
4075 } | |
4076 } | |
4077 | |
4078 void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged( | |
4079 ElementId element_id, | |
4080 ElementListType list_type, | |
4081 AnimationChangeType change_type, | |
4082 bool is_animating) { | |
4083 LayerTreeImpl* tree = | |
4084 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); | |
4085 if (!tree) | |
4086 return; | |
4087 LayerImpl* layer = tree->LayerByElementId(element_id); | |
4088 if (layer) { | |
4089 switch (change_type) { | |
4090 case AnimationChangeType::POTENTIAL: | |
4091 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); | |
4092 break; | |
4093 case AnimationChangeType::RUNNING: | |
4094 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); | |
4095 break; | |
4096 case AnimationChangeType::BOTH: | |
4097 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); | |
4098 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); | |
4099 break; | |
4100 } | |
4101 } | |
4102 } | |
4103 | |
4104 void LayerTreeHostImpl::ElementFilterIsAnimatingChanged( | |
4105 ElementId element_id, | |
4106 ElementListType list_type, | |
4107 AnimationChangeType change_type, | |
4108 bool is_animating) { | |
4109 LayerTreeImpl* tree = | |
4110 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); | |
4111 if (!tree) | |
4112 return; | |
4113 LayerImpl* layer = tree->LayerByElementId(element_id); | |
4114 if (layer) { | |
4115 switch (change_type) { | |
4116 case AnimationChangeType::POTENTIAL: | |
4117 layer->OnFilterIsPotentiallyAnimatingChanged(is_animating); | |
4118 break; | |
4119 case AnimationChangeType::RUNNING: | |
4120 layer->OnFilterIsCurrentlyAnimatingChanged(is_animating); | |
4121 break; | |
4122 case AnimationChangeType::BOTH: | |
4123 layer->OnFilterIsPotentiallyAnimatingChanged(is_animating); | |
4124 layer->OnFilterIsCurrentlyAnimatingChanged(is_animating); | |
4125 break; | |
4126 } | |
4127 } | |
4128 } | 4064 } |
4129 | 4065 |
4130 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { | 4066 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { |
4131 // TODO(majidvp): We should pass in the original starting scroll position here | 4067 // TODO(majidvp): We should pass in the original starting scroll position here |
4132 ScrollStateData scroll_state_data; | 4068 ScrollStateData scroll_state_data; |
4133 ScrollState scroll_state(scroll_state_data); | 4069 ScrollState scroll_state(scroll_state_data); |
4134 // TODO(Sahel): Once the touchpad scroll latching for Non-mac devices is | 4070 // TODO(Sahel): Once the touchpad scroll latching for Non-mac devices is |
4135 // implemented, the current scrolling layer should not get cleared after | 4071 // implemented, the current scrolling layer should not get cleared after |
4136 // each animation (crbug.com/526463). | 4072 // each animation (crbug.com/526463). |
4137 ScrollEnd(&scroll_state); | 4073 ScrollEnd(&scroll_state); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4197 if (is_visible) { | 4133 if (is_visible) { |
4198 worker_context_visibility_ = | 4134 worker_context_visibility_ = |
4199 worker_context->CacheController()->ClientBecameVisible(); | 4135 worker_context->CacheController()->ClientBecameVisible(); |
4200 } else { | 4136 } else { |
4201 worker_context->CacheController()->ClientBecameNotVisible( | 4137 worker_context->CacheController()->ClientBecameNotVisible( |
4202 std::move(worker_context_visibility_)); | 4138 std::move(worker_context_visibility_)); |
4203 } | 4139 } |
4204 } | 4140 } |
4205 | 4141 |
4206 } // namespace cc | 4142 } // namespace cc |
OLD | NEW |