OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/layer.h" | 5 #include "cc/layers/layer.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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 layer->SetTransformTreeIndex(transform_tree_index()); | 1137 layer->SetTransformTreeIndex(transform_tree_index()); |
1138 layer->SetEffectTreeIndex(effect_tree_index()); | 1138 layer->SetEffectTreeIndex(effect_tree_index()); |
1139 layer->SetClipTreeIndex(clip_tree_index()); | 1139 layer->SetClipTreeIndex(clip_tree_index()); |
1140 layer->SetScrollTreeIndex(scroll_tree_index()); | 1140 layer->SetScrollTreeIndex(scroll_tree_index()); |
1141 layer->set_offset_to_transform_parent(offset_to_transform_parent_); | 1141 layer->set_offset_to_transform_parent(offset_to_transform_parent_); |
1142 layer->SetDrawsContent(DrawsContent()); | 1142 layer->SetDrawsContent(DrawsContent()); |
1143 // subtree_property_changed_ is propagated to all descendants while building | 1143 // subtree_property_changed_ is propagated to all descendants while building |
1144 // property trees. So, it is enough to check it only for the current layer. | 1144 // property trees. So, it is enough to check it only for the current layer. |
1145 if (subtree_property_changed_ || layer_property_changed_) | 1145 if (subtree_property_changed_ || layer_property_changed_) |
1146 layer->NoteLayerPropertyChanged(); | 1146 layer->NoteLayerPropertyChanged(); |
1147 if (!FilterIsAnimating()) | |
1148 layer->SetFilters(inputs_.filters); | |
1149 layer->SetMasksToBounds(inputs_.masks_to_bounds); | 1147 layer->SetMasksToBounds(inputs_.masks_to_bounds); |
1150 layer->set_main_thread_scrolling_reasons( | 1148 layer->set_main_thread_scrolling_reasons( |
1151 inputs_.main_thread_scrolling_reasons); | 1149 inputs_.main_thread_scrolling_reasons); |
1152 layer->SetNonFastScrollableRegion(inputs_.non_fast_scrollable_region); | 1150 layer->SetNonFastScrollableRegion(inputs_.non_fast_scrollable_region); |
1153 layer->SetTouchEventHandlerRegion(inputs_.touch_event_handler_region); | 1151 layer->SetTouchEventHandlerRegion(inputs_.touch_event_handler_region); |
1154 layer->SetContentsOpaque(inputs_.contents_opaque); | 1152 layer->SetContentsOpaque(inputs_.contents_opaque); |
1155 layer->SetBlendMode(inputs_.blend_mode); | 1153 layer->SetBlendMode(inputs_.blend_mode); |
1156 layer->SetPosition(inputs_.position); | 1154 layer->SetPosition(inputs_.position); |
1157 layer->set_should_flatten_transform_from_property_tree( | 1155 layer->set_should_flatten_transform_from_property_tree( |
1158 should_flatten_transform_from_property_tree_); | 1156 should_flatten_transform_from_property_tree_); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 PropertyTrees* property_trees = layer_tree_host_->property_trees(); | 1724 PropertyTrees* property_trees = layer_tree_host_->property_trees(); |
1727 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) | 1725 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) |
1728 return; | 1726 return; |
1729 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); | 1727 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); |
1730 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); | 1728 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); |
1731 node->has_potential_opacity_animation = | 1729 node->has_potential_opacity_animation = |
1732 has_potential_animation || OpacityCanAnimateOnImplThread(); | 1730 has_potential_animation || OpacityCanAnimateOnImplThread(); |
1733 property_trees->effect_tree.set_needs_update(true); | 1731 property_trees->effect_tree.set_needs_update(true); |
1734 } | 1732 } |
1735 | 1733 |
| 1734 void Layer::OnFilterIsCurrentlyAnimatingChanged(bool is_currently_animating) { |
| 1735 DCHECK(layer_tree_host_); |
| 1736 PropertyTrees* property_trees = layer_tree_host_->property_trees(); |
| 1737 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) |
| 1738 return; |
| 1739 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); |
| 1740 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); |
| 1741 node->is_currently_animating_filter = is_currently_animating; |
| 1742 } |
| 1743 |
| 1744 void Layer::OnFilterIsPotentiallyAnimatingChanged( |
| 1745 bool has_potential_animation) { |
| 1746 DCHECK(layer_tree_host_); |
| 1747 PropertyTrees* property_trees = layer_tree_host_->property_trees(); |
| 1748 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) |
| 1749 return; |
| 1750 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); |
| 1751 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); |
| 1752 node->has_potential_filter_animation = has_potential_animation; |
| 1753 } |
| 1754 |
1736 bool Layer::HasActiveAnimationForTesting() const { | 1755 bool Layer::HasActiveAnimationForTesting() const { |
1737 return layer_tree_host_ | 1756 return layer_tree_host_ |
1738 ? GetAnimationHost()->HasActiveAnimationForTesting(element_id()) | 1757 ? GetAnimationHost()->HasActiveAnimationForTesting(element_id()) |
1739 : false; | 1758 : false; |
1740 } | 1759 } |
1741 | 1760 |
1742 void Layer::SetHasWillChangeTransformHint(bool has_will_change) { | 1761 void Layer::SetHasWillChangeTransformHint(bool has_will_change) { |
1743 if (inputs_.has_will_change_transform_hint == has_will_change) | 1762 if (inputs_.has_will_change_transform_hint == has_will_change) |
1744 return; | 1763 return; |
1745 inputs_.has_will_change_transform_hint = has_will_change; | 1764 inputs_.has_will_change_transform_hint = has_will_change; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 ->num_copy_requests_in_subtree; | 1862 ->num_copy_requests_in_subtree; |
1844 } | 1863 } |
1845 | 1864 |
1846 gfx::Transform Layer::screen_space_transform() const { | 1865 gfx::Transform Layer::screen_space_transform() const { |
1847 DCHECK_NE(transform_tree_index_, -1); | 1866 DCHECK_NE(transform_tree_index_, -1); |
1848 return draw_property_utils::ScreenSpaceTransform( | 1867 return draw_property_utils::ScreenSpaceTransform( |
1849 this, layer_tree_host_->property_trees()->transform_tree); | 1868 this, layer_tree_host_->property_trees()->transform_tree); |
1850 } | 1869 } |
1851 | 1870 |
1852 } // namespace cc | 1871 } // namespace cc |
OLD | NEW |