| 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 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, | 1698 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, |
| 1699 id())) | 1699 id())) |
| 1700 return; | 1700 return; |
| 1701 DCHECK_EQ(transform_tree_index(), | 1701 DCHECK_EQ(transform_tree_index(), |
| 1702 property_trees->transform_id_to_index_map[id()]); | 1702 property_trees->transform_id_to_index_map[id()]); |
| 1703 TransformNode* node = | 1703 TransformNode* node = |
| 1704 property_trees->transform_tree.Node(transform_tree_index()); | 1704 property_trees->transform_tree.Node(transform_tree_index()); |
| 1705 | 1705 |
| 1706 node->data.has_potential_animation = has_potential_animation; | 1706 node->data.has_potential_animation = has_potential_animation; |
| 1707 if (has_potential_animation) { | 1707 if (has_potential_animation) { |
| 1708 float maximum_target_scale = 0.f; | |
| 1709 node->data.local_maximum_animation_target_scale = | |
| 1710 MaximumTargetScale(&maximum_target_scale) ? maximum_target_scale : 0.f; | |
| 1711 | |
| 1712 float animation_start_scale = 0.f; | |
| 1713 node->data.local_starting_animation_scale = | |
| 1714 AnimationStartScale(&animation_start_scale) ? animation_start_scale | |
| 1715 : 0.f; | |
| 1716 | |
| 1717 node->data.has_only_translation_animations = HasOnlyTranslationTransforms(); | 1708 node->data.has_only_translation_animations = HasOnlyTranslationTransforms(); |
| 1718 | 1709 } else { |
| 1719 } else { | 1710 node->data.has_only_translation_animations = true; |
| 1720 node->data.local_maximum_animation_target_scale = 0.f; | 1711 } |
| 1721 node->data.local_starting_animation_scale = 0.f; | 1712 property_trees->transform_tree.set_needs_update(true); |
| 1722 node->data.has_only_translation_animations = true; | |
| 1723 } | |
| 1724 property_trees->transform_tree.set_needs_update(true); | |
| 1725 } | 1713 } |
| 1726 | 1714 |
| 1727 void Layer::OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating) { | 1715 void Layer::OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating) { |
| 1728 DCHECK(layer_tree_host_); | 1716 DCHECK(layer_tree_host_); |
| 1729 PropertyTrees* property_trees = layer_tree_host_->property_trees(); | 1717 PropertyTrees* property_trees = layer_tree_host_->property_trees(); |
| 1730 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) | 1718 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) |
| 1731 return; | 1719 return; |
| 1732 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); | 1720 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); |
| 1733 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); | 1721 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); |
| 1734 node->data.is_currently_animating_opacity = is_currently_animating; | 1722 node->data.is_currently_animating_opacity = is_currently_animating; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 ->data.num_copy_requests_in_subtree; | 1827 ->data.num_copy_requests_in_subtree; |
| 1840 } | 1828 } |
| 1841 | 1829 |
| 1842 gfx::Transform Layer::screen_space_transform() const { | 1830 gfx::Transform Layer::screen_space_transform() const { |
| 1843 DCHECK_NE(transform_tree_index_, -1); | 1831 DCHECK_NE(transform_tree_index_, -1); |
| 1844 return draw_property_utils::ScreenSpaceTransform( | 1832 return draw_property_utils::ScreenSpaceTransform( |
| 1845 this, layer_tree_host_->property_trees()->transform_tree); | 1833 this, layer_tree_host_->property_trees()->transform_tree); |
| 1846 } | 1834 } |
| 1847 | 1835 |
| 1848 } // namespace cc | 1836 } // namespace cc |
| OLD | NEW |