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 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3999 ElementListType list_type, | 3999 ElementListType list_type, |
4000 const gfx::ScrollOffset& scroll_offset) { | 4000 const gfx::ScrollOffset& scroll_offset) { |
4001 if (list_type == ElementListType::ACTIVE) { | 4001 if (list_type == ElementListType::ACTIVE) { |
4002 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); | 4002 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); |
4003 } else { | 4003 } else { |
4004 SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset); | 4004 SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset); |
4005 SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset); | 4005 SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset); |
4006 } | 4006 } |
4007 } | 4007 } |
4008 | 4008 |
4009 void LayerTreeHostImpl::ElementTransformIsAnimatingChanged( | 4009 void LayerTreeHostImpl::ElementIsAnimatingChanged( |
4010 ElementId element_id, | 4010 ElementId element_id, |
4011 ElementListType list_type, | 4011 ElementListType list_type, |
4012 AnimationChangeType change_type, | 4012 const PropertyAnimationState& mask, |
4013 bool is_animating) { | 4013 const PropertyAnimationState& state) { |
4014 LayerTreeImpl* tree = | 4014 LayerTreeImpl* tree = |
4015 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); | 4015 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); |
4016 if (!tree) | 4016 if (!tree) |
4017 return; | 4017 return; |
4018 LayerImpl* layer = tree->LayerByElementId(element_id); | 4018 LayerImpl* layer = tree->LayerByElementId(element_id); |
4019 if (layer) { | 4019 if (layer) |
4020 switch (change_type) { | 4020 layer->OnIsAnimatingChanged(mask, state); |
4021 case AnimationChangeType::POTENTIAL: | |
4022 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); | |
4023 break; | |
4024 case AnimationChangeType::RUNNING: | |
4025 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); | |
4026 break; | |
4027 case AnimationChangeType::BOTH: | |
4028 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); | |
4029 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); | |
4030 break; | |
4031 } | |
4032 } | |
4033 } | |
4034 | |
4035 void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged( | |
4036 ElementId element_id, | |
4037 ElementListType list_type, | |
4038 AnimationChangeType change_type, | |
4039 bool is_animating) { | |
4040 LayerTreeImpl* tree = | |
4041 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); | |
4042 if (!tree) | |
4043 return; | |
4044 LayerImpl* layer = tree->LayerByElementId(element_id); | |
4045 if (layer) { | |
4046 switch (change_type) { | |
4047 case AnimationChangeType::POTENTIAL: | |
4048 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); | |
4049 break; | |
4050 case AnimationChangeType::RUNNING: | |
4051 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); | |
4052 break; | |
4053 case AnimationChangeType::BOTH: | |
4054 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); | |
4055 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); | |
4056 break; | |
4057 } | |
4058 } | |
4059 } | |
4060 | |
4061 void LayerTreeHostImpl::ElementFilterIsAnimatingChanged( | |
4062 ElementId element_id, | |
4063 ElementListType list_type, | |
4064 AnimationChangeType change_type, | |
4065 bool is_animating) { | |
4066 LayerTreeImpl* tree = | |
4067 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); | |
4068 if (!tree) | |
4069 return; | |
4070 LayerImpl* layer = tree->LayerByElementId(element_id); | |
4071 if (layer) { | |
4072 switch (change_type) { | |
4073 case AnimationChangeType::POTENTIAL: | |
4074 layer->OnFilterIsPotentiallyAnimatingChanged(is_animating); | |
4075 break; | |
4076 case AnimationChangeType::RUNNING: | |
4077 layer->OnFilterIsCurrentlyAnimatingChanged(is_animating); | |
4078 break; | |
4079 case AnimationChangeType::BOTH: | |
4080 layer->OnFilterIsPotentiallyAnimatingChanged(is_animating); | |
4081 layer->OnFilterIsCurrentlyAnimatingChanged(is_animating); | |
4082 break; | |
4083 } | |
4084 } | |
4085 } | 4021 } |
4086 | 4022 |
4087 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { | 4023 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { |
4088 // TODO(majidvp): We should pass in the original starting scroll position here | 4024 // TODO(majidvp): We should pass in the original starting scroll position here |
4089 ScrollStateData scroll_state_data; | 4025 ScrollStateData scroll_state_data; |
4090 ScrollState scroll_state(scroll_state_data); | 4026 ScrollState scroll_state(scroll_state_data); |
4091 // TODO(Sahel): Once the touchpad scroll latching for Non-mac devices is | 4027 // TODO(Sahel): Once the touchpad scroll latching for Non-mac devices is |
4092 // implemented, the current scrolling layer should not get cleared after | 4028 // implemented, the current scrolling layer should not get cleared after |
4093 // each animation (crbug.com/526463). | 4029 // each animation (crbug.com/526463). |
4094 ScrollEnd(&scroll_state); | 4030 ScrollEnd(&scroll_state); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4154 if (is_visible) { | 4090 if (is_visible) { |
4155 worker_context_visibility_ = | 4091 worker_context_visibility_ = |
4156 worker_context->CacheController()->ClientBecameVisible(); | 4092 worker_context->CacheController()->ClientBecameVisible(); |
4157 } else { | 4093 } else { |
4158 worker_context->CacheController()->ClientBecameNotVisible( | 4094 worker_context->CacheController()->ClientBecameNotVisible( |
4159 std::move(worker_context_visibility_)); | 4095 std::move(worker_context_visibility_)); |
4160 } | 4096 } |
4161 } | 4097 } |
4162 | 4098 |
4163 } // namespace cc | 4099 } // namespace cc |
OLD | NEW |