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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "cc/layers/layer.h" | 25 #include "cc/layers/layer.h" |
26 #include "cc/layers/layer_iterator.h" | 26 #include "cc/layers/layer_iterator.h" |
27 #include "cc/layers/render_surface_impl.h" | 27 #include "cc/layers/render_surface_impl.h" |
28 #include "cc/layers/scrollbar_layer_impl_base.h" | 28 #include "cc/layers/scrollbar_layer_impl_base.h" |
29 #include "cc/resources/ui_resource_request.h" | 29 #include "cc/resources/ui_resource_request.h" |
30 #include "cc/trees/layer_tree_host_common.h" | 30 #include "cc/trees/layer_tree_host_common.h" |
31 #include "cc/trees/layer_tree_host_impl.h" | 31 #include "cc/trees/layer_tree_host_impl.h" |
32 #include "cc/trees/occlusion_tracker.h" | 32 #include "cc/trees/occlusion_tracker.h" |
33 #include "cc/trees/property_tree.h" | 33 #include "cc/trees/property_tree.h" |
34 #include "cc/trees/property_tree_builder.h" | 34 #include "cc/trees/property_tree_builder.h" |
| 35 #include "ui/gfx/geometry/box_f.h" |
35 #include "ui/gfx/geometry/point_conversions.h" | 36 #include "ui/gfx/geometry/point_conversions.h" |
36 #include "ui/gfx/geometry/size_conversions.h" | 37 #include "ui/gfx/geometry/size_conversions.h" |
37 #include "ui/gfx/geometry/vector2d_conversions.h" | 38 #include "ui/gfx/geometry/vector2d_conversions.h" |
38 | 39 |
39 namespace cc { | 40 namespace cc { |
40 | 41 |
41 LayerTreeImpl::LayerTreeImpl( | 42 LayerTreeImpl::LayerTreeImpl( |
42 LayerTreeHostImpl* layer_tree_host_impl, | 43 LayerTreeHostImpl* layer_tree_host_impl, |
43 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 44 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
44 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, | 45 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 void LayerTreeImpl::SetPendingPageScaleAnimation( | 1619 void LayerTreeImpl::SetPendingPageScaleAnimation( |
1619 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1620 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
1620 pending_page_scale_animation_ = pending_animation.Pass(); | 1621 pending_page_scale_animation_ = pending_animation.Pass(); |
1621 } | 1622 } |
1622 | 1623 |
1623 scoped_ptr<PendingPageScaleAnimation> | 1624 scoped_ptr<PendingPageScaleAnimation> |
1624 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1625 LayerTreeImpl::TakePendingPageScaleAnimation() { |
1625 return pending_page_scale_animation_.Pass(); | 1626 return pending_page_scale_animation_.Pass(); |
1626 } | 1627 } |
1627 | 1628 |
| 1629 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { |
| 1630 return layer_tree_host_impl_->animation_host() |
| 1631 ? layer_tree_host_impl_->animation_host() |
| 1632 ->IsAnimatingFilterProperty(layer->id()) |
| 1633 : false; |
| 1634 } |
| 1635 |
| 1636 bool LayerTreeImpl::IsAnimatingOpacityProperty(const LayerImpl* layer) const { |
| 1637 return layer_tree_host_impl_->animation_host() |
| 1638 ? layer_tree_host_impl_->animation_host() |
| 1639 ->IsAnimatingOpacityProperty(layer->id()) |
| 1640 : false; |
| 1641 } |
| 1642 |
| 1643 bool LayerTreeImpl::IsAnimatingTransformProperty(const LayerImpl* layer) const { |
| 1644 return layer_tree_host_impl_->animation_host() |
| 1645 ? layer_tree_host_impl_->animation_host() |
| 1646 ->IsAnimatingTransformProperty(layer->id()) |
| 1647 : false; |
| 1648 } |
| 1649 |
| 1650 bool LayerTreeImpl::HasPotentiallyRunningOpacityAnimation( |
| 1651 const LayerImpl* layer) const { |
| 1652 return layer_tree_host_impl_->animation_host() |
| 1653 ? layer_tree_host_impl_->animation_host() |
| 1654 ->HasPotentiallyRunningOpacityAnimation(layer->id()) |
| 1655 : false; |
| 1656 } |
| 1657 |
| 1658 bool LayerTreeImpl::HasPotentiallyRunningTransformAnimation( |
| 1659 const LayerImpl* layer) const { |
| 1660 return layer_tree_host_impl_->animation_host() |
| 1661 ? layer_tree_host_impl_->animation_host() |
| 1662 ->HasPotentiallyRunningTransformAnimation(layer->id()) |
| 1663 : false; |
| 1664 } |
| 1665 |
| 1666 bool LayerTreeImpl::FilterIsAnimatingOnImplOnly(const LayerImpl* layer) const { |
| 1667 return layer_tree_host_impl_->animation_host() |
| 1668 ? layer_tree_host_impl_->animation_host() |
| 1669 ->FilterIsAnimatingOnImplOnly(layer->id()) |
| 1670 : false; |
| 1671 } |
| 1672 |
| 1673 bool LayerTreeImpl::OpacityIsAnimatingOnImplOnly(const LayerImpl* layer) const { |
| 1674 return layer_tree_host_impl_->animation_host() |
| 1675 ? layer_tree_host_impl_->animation_host() |
| 1676 ->OpacityIsAnimatingOnImplOnly(layer->id()) |
| 1677 : false; |
| 1678 } |
| 1679 |
| 1680 bool LayerTreeImpl::TransformIsAnimatingOnImplOnly( |
| 1681 const LayerImpl* layer) const { |
| 1682 return layer_tree_host_impl_->animation_host() |
| 1683 ? layer_tree_host_impl_->animation_host() |
| 1684 ->TransformIsAnimatingOnImplOnly(layer->id()) |
| 1685 : false; |
| 1686 } |
| 1687 |
| 1688 bool LayerTreeImpl::HasOnlyTranslationTransforms(const LayerImpl* layer) const { |
| 1689 return layer_tree_host_impl_->animation_host() |
| 1690 ? layer_tree_host_impl_->animation_host() |
| 1691 ->HasOnlyTranslationTransforms(layer->id()) |
| 1692 : true; |
| 1693 } |
| 1694 |
| 1695 bool LayerTreeImpl::MaximumTargetScale(const LayerImpl* layer, |
| 1696 float* max_scale) const { |
| 1697 *max_scale = 0.f; |
| 1698 return layer_tree_host_impl_->animation_host() |
| 1699 ? layer_tree_host_impl_->animation_host()->MaximumTargetScale( |
| 1700 layer->id(), max_scale) |
| 1701 : true; |
| 1702 } |
| 1703 |
| 1704 bool LayerTreeImpl::AnimationStartScale(const LayerImpl* layer, |
| 1705 float* start_scale) const { |
| 1706 *start_scale = 0.f; |
| 1707 return layer_tree_host_impl_->animation_host() |
| 1708 ? layer_tree_host_impl_->animation_host()->AnimationStartScale( |
| 1709 layer->id(), start_scale) |
| 1710 : true; |
| 1711 } |
| 1712 |
| 1713 bool LayerTreeImpl::HasFilterAnimationThatInflatesBounds( |
| 1714 const LayerImpl* layer) const { |
| 1715 return layer_tree_host_impl_->animation_host() |
| 1716 ? layer_tree_host_impl_->animation_host() |
| 1717 ->HasFilterAnimationThatInflatesBounds(layer->id()) |
| 1718 : false; |
| 1719 } |
| 1720 |
| 1721 bool LayerTreeImpl::HasTransformAnimationThatInflatesBounds( |
| 1722 const LayerImpl* layer) const { |
| 1723 return layer_tree_host_impl_->animation_host() |
| 1724 ? layer_tree_host_impl_->animation_host() |
| 1725 ->HasTransformAnimationThatInflatesBounds(layer->id()) |
| 1726 : false; |
| 1727 } |
| 1728 |
| 1729 bool LayerTreeImpl::HasAnimationThatInflatesBounds( |
| 1730 const LayerImpl* layer) const { |
| 1731 return layer_tree_host_impl_->animation_host() |
| 1732 ? layer_tree_host_impl_->animation_host() |
| 1733 ->HasAnimationThatInflatesBounds(layer->id()) |
| 1734 : false; |
| 1735 } |
| 1736 |
| 1737 bool LayerTreeImpl::FilterAnimationBoundsForBox(const LayerImpl* layer, |
| 1738 const gfx::BoxF& box, |
| 1739 gfx::BoxF* bounds) const { |
| 1740 return layer_tree_host_impl_->animation_host() |
| 1741 ? layer_tree_host_impl_->animation_host() |
| 1742 ->FilterAnimationBoundsForBox(layer->id(), box, bounds) |
| 1743 : false; |
| 1744 } |
| 1745 |
| 1746 bool LayerTreeImpl::TransformAnimationBoundsForBox(const LayerImpl* layer, |
| 1747 const gfx::BoxF& box, |
| 1748 gfx::BoxF* bounds) const { |
| 1749 *bounds = gfx::BoxF(); |
| 1750 return layer_tree_host_impl_->animation_host() |
| 1751 ? layer_tree_host_impl_->animation_host() |
| 1752 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
| 1753 : true; |
| 1754 } |
| 1755 |
1628 } // namespace cc | 1756 } // namespace cc |
OLD | NEW |