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 13 matching lines...) Expand all Loading... |
24 #include "cc/input/page_scale_animation.h" | 24 #include "cc/input/page_scale_animation.h" |
25 #include "cc/layers/heads_up_display_layer_impl.h" | 25 #include "cc/layers/heads_up_display_layer_impl.h" |
26 #include "cc/layers/layer.h" | 26 #include "cc/layers/layer.h" |
27 #include "cc/layers/layer_iterator.h" | 27 #include "cc/layers/layer_iterator.h" |
28 #include "cc/layers/render_surface_impl.h" | 28 #include "cc/layers/render_surface_impl.h" |
29 #include "cc/layers/scrollbar_layer_impl_base.h" | 29 #include "cc/layers/scrollbar_layer_impl_base.h" |
30 #include "cc/resources/ui_resource_request.h" | 30 #include "cc/resources/ui_resource_request.h" |
31 #include "cc/trees/layer_tree_host_common.h" | 31 #include "cc/trees/layer_tree_host_common.h" |
32 #include "cc/trees/layer_tree_host_impl.h" | 32 #include "cc/trees/layer_tree_host_impl.h" |
33 #include "cc/trees/occlusion_tracker.h" | 33 #include "cc/trees/occlusion_tracker.h" |
| 34 #include "ui/gfx/geometry/box_f.h" |
34 #include "ui/gfx/geometry/point_conversions.h" | 35 #include "ui/gfx/geometry/point_conversions.h" |
35 #include "ui/gfx/geometry/size_conversions.h" | 36 #include "ui/gfx/geometry/size_conversions.h" |
36 #include "ui/gfx/geometry/vector2d_conversions.h" | 37 #include "ui/gfx/geometry/vector2d_conversions.h" |
37 | 38 |
38 namespace cc { | 39 namespace cc { |
39 | 40 |
40 LayerTreeImpl::LayerTreeImpl( | 41 LayerTreeImpl::LayerTreeImpl( |
41 LayerTreeHostImpl* layer_tree_host_impl, | 42 LayerTreeHostImpl* layer_tree_host_impl, |
42 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 43 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
43 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, | 44 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 void LayerTreeImpl::SetPendingPageScaleAnimation( | 1572 void LayerTreeImpl::SetPendingPageScaleAnimation( |
1572 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1573 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
1573 pending_page_scale_animation_ = pending_animation.Pass(); | 1574 pending_page_scale_animation_ = pending_animation.Pass(); |
1574 } | 1575 } |
1575 | 1576 |
1576 scoped_ptr<PendingPageScaleAnimation> | 1577 scoped_ptr<PendingPageScaleAnimation> |
1577 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1578 LayerTreeImpl::TakePendingPageScaleAnimation() { |
1578 return pending_page_scale_animation_.Pass(); | 1579 return pending_page_scale_animation_.Pass(); |
1579 } | 1580 } |
1580 | 1581 |
| 1582 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { |
| 1583 return layer_tree_host_impl_->animation_host() |
| 1584 ? layer_tree_host_impl_->animation_host() |
| 1585 ->IsAnimatingFilterProperty(layer->id()) |
| 1586 : false; |
| 1587 } |
| 1588 |
| 1589 bool LayerTreeImpl::IsAnimatingOpacityProperty(const LayerImpl* layer) const { |
| 1590 return layer_tree_host_impl_->animation_host() |
| 1591 ? layer_tree_host_impl_->animation_host() |
| 1592 ->IsAnimatingOpacityProperty(layer->id()) |
| 1593 : false; |
| 1594 } |
| 1595 |
| 1596 bool LayerTreeImpl::IsAnimatingTransformProperty(const LayerImpl* layer) const { |
| 1597 return layer_tree_host_impl_->animation_host() |
| 1598 ? layer_tree_host_impl_->animation_host() |
| 1599 ->IsAnimatingTransformProperty(layer->id()) |
| 1600 : false; |
| 1601 } |
| 1602 |
| 1603 bool LayerTreeImpl::HasPotentiallyRunningOpacityAnimation( |
| 1604 const LayerImpl* layer) const { |
| 1605 return layer_tree_host_impl_->animation_host() |
| 1606 ? layer_tree_host_impl_->animation_host() |
| 1607 ->HasPotentiallyRunningOpacityAnimation(layer->id()) |
| 1608 : false; |
| 1609 } |
| 1610 |
| 1611 bool LayerTreeImpl::HasPotentiallyRunningTransformAnimation( |
| 1612 const LayerImpl* layer) const { |
| 1613 return layer_tree_host_impl_->animation_host() |
| 1614 ? layer_tree_host_impl_->animation_host() |
| 1615 ->HasPotentiallyRunningTransformAnimation(layer->id()) |
| 1616 : false; |
| 1617 } |
| 1618 |
| 1619 bool LayerTreeImpl::FilterIsAnimatingOnImplOnly(const LayerImpl* layer) const { |
| 1620 return layer_tree_host_impl_->animation_host() |
| 1621 ? layer_tree_host_impl_->animation_host() |
| 1622 ->FilterIsAnimatingOnImplOnly(layer->id()) |
| 1623 : false; |
| 1624 } |
| 1625 |
| 1626 bool LayerTreeImpl::OpacityIsAnimatingOnImplOnly(const LayerImpl* layer) const { |
| 1627 return layer_tree_host_impl_->animation_host() |
| 1628 ? layer_tree_host_impl_->animation_host() |
| 1629 ->OpacityIsAnimatingOnImplOnly(layer->id()) |
| 1630 : false; |
| 1631 } |
| 1632 |
| 1633 bool LayerTreeImpl::TransformIsAnimatingOnImplOnly( |
| 1634 const LayerImpl* layer) const { |
| 1635 return layer_tree_host_impl_->animation_host() |
| 1636 ? layer_tree_host_impl_->animation_host() |
| 1637 ->TransformIsAnimatingOnImplOnly(layer->id()) |
| 1638 : false; |
| 1639 } |
| 1640 |
| 1641 bool LayerTreeImpl::HasOnlyTranslationTransforms(const LayerImpl* layer) const { |
| 1642 return layer_tree_host_impl_->animation_host() |
| 1643 ? layer_tree_host_impl_->animation_host() |
| 1644 ->HasOnlyTranslationTransforms(layer->id()) |
| 1645 : true; |
| 1646 } |
| 1647 |
| 1648 bool LayerTreeImpl::MaximumTargetScale(const LayerImpl* layer, |
| 1649 float* max_scale) const { |
| 1650 *max_scale = 0.f; |
| 1651 return layer_tree_host_impl_->animation_host() |
| 1652 ? layer_tree_host_impl_->animation_host()->MaximumTargetScale( |
| 1653 layer->id(), max_scale) |
| 1654 : true; |
| 1655 } |
| 1656 |
| 1657 bool LayerTreeImpl::HasFilterAnimationThatInflatesBounds( |
| 1658 const LayerImpl* layer) const { |
| 1659 return layer_tree_host_impl_->animation_host() |
| 1660 ? layer_tree_host_impl_->animation_host() |
| 1661 ->HasFilterAnimationThatInflatesBounds(layer->id()) |
| 1662 : false; |
| 1663 } |
| 1664 |
| 1665 bool LayerTreeImpl::HasTransformAnimationThatInflatesBounds( |
| 1666 const LayerImpl* layer) const { |
| 1667 return layer_tree_host_impl_->animation_host() |
| 1668 ? layer_tree_host_impl_->animation_host() |
| 1669 ->HasTransformAnimationThatInflatesBounds(layer->id()) |
| 1670 : false; |
| 1671 } |
| 1672 |
| 1673 bool LayerTreeImpl::HasAnimationThatInflatesBounds( |
| 1674 const LayerImpl* layer) const { |
| 1675 return layer_tree_host_impl_->animation_host() |
| 1676 ? layer_tree_host_impl_->animation_host() |
| 1677 ->HasAnimationThatInflatesBounds(layer->id()) |
| 1678 : false; |
| 1679 } |
| 1680 |
| 1681 bool LayerTreeImpl::FilterAnimationBoundsForBox(const LayerImpl* layer, |
| 1682 const gfx::BoxF& box, |
| 1683 gfx::BoxF* bounds) const { |
| 1684 return layer_tree_host_impl_->animation_host() |
| 1685 ? layer_tree_host_impl_->animation_host() |
| 1686 ->FilterAnimationBoundsForBox(layer->id(), box, bounds) |
| 1687 : false; |
| 1688 } |
| 1689 |
| 1690 bool LayerTreeImpl::TransformAnimationBoundsForBox(const LayerImpl* layer, |
| 1691 const gfx::BoxF& box, |
| 1692 gfx::BoxF* bounds) const { |
| 1693 *bounds = gfx::BoxF(); |
| 1694 return layer_tree_host_impl_->animation_host() |
| 1695 ? layer_tree_host_impl_->animation_host() |
| 1696 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
| 1697 : true; |
| 1698 } |
| 1699 |
1581 } // namespace cc | 1700 } // namespace cc |
OLD | NEW |