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 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 | 1660 |
1661 } else { | 1661 } else { |
1662 node->data.local_maximum_animation_target_scale = 0.f; | 1662 node->data.local_maximum_animation_target_scale = 0.f; |
1663 node->data.local_starting_animation_scale = 0.f; | 1663 node->data.local_starting_animation_scale = 0.f; |
1664 node->data.has_only_translation_animations = true; | 1664 node->data.has_only_translation_animations = true; |
1665 } | 1665 } |
1666 transform_tree.set_needs_update(true); | 1666 transform_tree.set_needs_update(true); |
1667 } | 1667 } |
1668 } | 1668 } |
1669 | 1669 |
| 1670 void Layer::OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating) { |
| 1671 DCHECK(layer_tree_host_); |
| 1672 EffectTree& effect_tree = layer_tree_host_->property_trees()->effect_tree; |
| 1673 EffectNode* node = effect_tree.Node(effect_tree_index()); |
| 1674 if (!node) |
| 1675 return; |
| 1676 |
| 1677 if (node->owner_id == id()) |
| 1678 node->data.is_currently_animating_opacity = is_currently_animating; |
| 1679 } |
| 1680 |
| 1681 void Layer::OnOpacityIsPotentiallyAnimatingChanged( |
| 1682 bool has_potential_animation) { |
| 1683 DCHECK(layer_tree_host_); |
| 1684 EffectTree& effect_tree = layer_tree_host_->property_trees()->effect_tree; |
| 1685 EffectNode* node = effect_tree.Node(effect_tree_index()); |
| 1686 if (!node) |
| 1687 return; |
| 1688 if (node->owner_id == id()) { |
| 1689 node->data.has_potential_opacity_animation = |
| 1690 has_potential_animation || OpacityCanAnimateOnImplThread(); |
| 1691 effect_tree.set_needs_update(true); |
| 1692 } |
| 1693 } |
| 1694 |
1670 bool Layer::HasActiveAnimationForTesting() const { | 1695 bool Layer::HasActiveAnimationForTesting() const { |
1671 return layer_tree_host_ ? layer_tree_host_->HasActiveAnimationForTesting(this) | 1696 return layer_tree_host_ ? layer_tree_host_->HasActiveAnimationForTesting(this) |
1672 : false; | 1697 : false; |
1673 } | 1698 } |
1674 | 1699 |
1675 ScrollbarLayerInterface* Layer::ToScrollbarLayer() { | 1700 ScrollbarLayerInterface* Layer::ToScrollbarLayer() { |
1676 return nullptr; | 1701 return nullptr; |
1677 } | 1702 } |
1678 | 1703 |
1679 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { | 1704 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 ->data.num_copy_requests_in_subtree; | 1777 ->data.num_copy_requests_in_subtree; |
1753 } | 1778 } |
1754 | 1779 |
1755 gfx::Transform Layer::screen_space_transform() const { | 1780 gfx::Transform Layer::screen_space_transform() const { |
1756 DCHECK_NE(transform_tree_index_, -1); | 1781 DCHECK_NE(transform_tree_index_, -1); |
1757 return draw_property_utils::ScreenSpaceTransform( | 1782 return draw_property_utils::ScreenSpaceTransform( |
1758 this, layer_tree_host_->property_trees()->transform_tree); | 1783 this, layer_tree_host_->property_trees()->transform_tree); |
1759 } | 1784 } |
1760 | 1785 |
1761 } // namespace cc | 1786 } // namespace cc |
OLD | NEW |