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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1978 void LayerTreeImpl::SetPendingPageScaleAnimation( | 1978 void LayerTreeImpl::SetPendingPageScaleAnimation( |
1979 std::unique_ptr<PendingPageScaleAnimation> pending_animation) { | 1979 std::unique_ptr<PendingPageScaleAnimation> pending_animation) { |
1980 pending_page_scale_animation_ = std::move(pending_animation); | 1980 pending_page_scale_animation_ = std::move(pending_animation); |
1981 } | 1981 } |
1982 | 1982 |
1983 std::unique_ptr<PendingPageScaleAnimation> | 1983 std::unique_ptr<PendingPageScaleAnimation> |
1984 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1984 LayerTreeImpl::TakePendingPageScaleAnimation() { |
1985 return std::move(pending_page_scale_animation_); | 1985 return std::move(pending_page_scale_animation_); |
1986 } | 1986 } |
1987 | 1987 |
1988 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { | |
1989 ElementListType list_type = | |
1990 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
1991 return layer_tree_host_impl_->animation_host()->IsAnimatingFilterProperty( | |
1992 layer->element_id(), list_type); | |
1993 } | |
1994 | |
1995 bool LayerTreeImpl::IsAnimatingOpacityProperty(const LayerImpl* layer) const { | |
1996 ElementListType list_type = | |
1997 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
1998 return layer_tree_host_impl_->animation_host()->IsAnimatingOpacityProperty( | |
1999 layer->element_id(), list_type); | |
2000 } | |
2001 | |
2002 bool LayerTreeImpl::IsAnimatingTransformProperty(const LayerImpl* layer) const { | |
2003 ElementListType list_type = | |
2004 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2005 return layer_tree_host_impl_->animation_host()->IsAnimatingTransformProperty( | |
2006 layer->element_id(), list_type); | |
2007 } | |
2008 | |
2009 bool LayerTreeImpl::HasPotentiallyRunningFilterAnimation( | |
2010 const LayerImpl* layer) const { | |
2011 ElementListType list_type = | |
2012 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2013 return layer_tree_host_impl_->animation_host() | |
2014 ->HasPotentiallyRunningFilterAnimation(layer->element_id(), list_type); | |
2015 } | |
2016 | |
2017 bool LayerTreeImpl::HasPotentiallyRunningOpacityAnimation( | |
2018 const LayerImpl* layer) const { | |
2019 ElementListType list_type = | |
2020 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2021 return layer_tree_host_impl_->animation_host() | |
2022 ->HasPotentiallyRunningOpacityAnimation(layer->element_id(), list_type); | |
2023 } | |
2024 | |
2025 bool LayerTreeImpl::HasPotentiallyRunningTransformAnimation( | |
2026 const LayerImpl* layer) const { | |
2027 ElementListType list_type = | |
2028 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2029 return layer_tree_host_impl_->animation_host() | |
2030 ->HasPotentiallyRunningTransformAnimation(layer->element_id(), list_type); | |
2031 } | |
2032 | |
2033 bool LayerTreeImpl::HasAnyAnimationTargetingProperty( | |
2034 const LayerImpl* layer, | |
2035 TargetProperty::Type property) const { | |
2036 return layer_tree_host_impl_->animation_host() | |
2037 ->HasAnyAnimationTargetingProperty(layer->element_id(), property); | |
2038 } | |
2039 | |
2040 bool LayerTreeImpl::AnimationsPreserveAxisAlignment( | |
2041 const LayerImpl* layer) const { | |
2042 return layer_tree_host_impl_->animation_host() | |
2043 ->AnimationsPreserveAxisAlignment(layer->element_id()); | |
2044 } | |
2045 | |
2046 bool LayerTreeImpl::HasOnlyTranslationTransforms(const LayerImpl* layer) const { | |
2047 ElementListType list_type = | |
2048 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2049 return layer_tree_host_impl_->animation_host()->HasOnlyTranslationTransforms( | |
2050 layer->element_id(), list_type); | |
2051 } | |
2052 | |
2053 bool LayerTreeImpl::MaximumTargetScale(const LayerImpl* layer, | |
2054 float* max_scale) const { | |
2055 *max_scale = 0.f; | |
2056 ElementListType list_type = | |
2057 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2058 return layer_tree_host_impl_->animation_host()->MaximumTargetScale( | |
2059 layer->element_id(), list_type, max_scale); | |
2060 } | |
2061 | |
2062 bool LayerTreeImpl::AnimationStartScale(const LayerImpl* layer, | |
2063 float* start_scale) const { | |
2064 *start_scale = 0.f; | |
2065 ElementListType list_type = | |
2066 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING; | |
2067 return layer_tree_host_impl_->animation_host()->AnimationStartScale( | |
2068 layer->element_id(), list_type, start_scale); | |
2069 } | |
2070 | |
2071 bool LayerTreeImpl::HasFilterAnimationThatInflatesBounds( | |
2072 const LayerImpl* layer) const { | |
2073 return layer_tree_host_impl_->animation_host() | |
2074 ->HasFilterAnimationThatInflatesBounds(layer->element_id()); | |
2075 } | |
2076 | |
2077 bool LayerTreeImpl::HasTransformAnimationThatInflatesBounds( | |
2078 const LayerImpl* layer) const { | |
2079 return layer_tree_host_impl_->animation_host() | |
2080 ->HasTransformAnimationThatInflatesBounds(layer->element_id()); | |
2081 } | |
2082 | |
2083 bool LayerTreeImpl::HasAnimationThatInflatesBounds( | |
2084 const LayerImpl* layer) const { | |
2085 return layer_tree_host_impl_->animation_host() | |
2086 ->HasAnimationThatInflatesBounds(layer->element_id()); | |
2087 } | |
2088 | |
2089 bool LayerTreeImpl::FilterAnimationBoundsForBox(const LayerImpl* layer, | |
2090 const gfx::BoxF& box, | |
2091 gfx::BoxF* bounds) const { | |
2092 return layer_tree_host_impl_->animation_host()->FilterAnimationBoundsForBox( | |
2093 layer->element_id(), box, bounds); | |
2094 } | |
2095 | |
2096 bool LayerTreeImpl::TransformAnimationBoundsForBox(const LayerImpl* layer, | |
2097 const gfx::BoxF& box, | |
2098 gfx::BoxF* bounds) const { | |
2099 *bounds = gfx::BoxF(); | |
2100 return layer_tree_host_impl_->animation_host() | |
2101 ->TransformAnimationBoundsForBox(layer->element_id(), box, bounds); | |
2102 } | |
2103 | |
2104 void LayerTreeImpl::ScrollAnimationAbort(bool needs_completion) { | 1988 void LayerTreeImpl::ScrollAnimationAbort(bool needs_completion) { |
2105 layer_tree_host_impl_->animation_host()->ScrollAnimationAbort( | 1989 layer_tree_host_impl_->animation_host()->ScrollAnimationAbort( |
2106 needs_completion); | 1990 needs_completion); |
2107 } | 1991 } |
2108 | 1992 |
2109 void LayerTreeImpl::ResetAllChangeTracking() { | 1993 void LayerTreeImpl::ResetAllChangeTracking() { |
2110 layers_that_should_push_properties_.clear(); | 1994 layers_that_should_push_properties_.clear(); |
2111 // Iterate over all layers, including masks and replicas. | 1995 // Iterate over all layers, including masks and replicas. |
2112 for (auto& layer : *layers_) | 1996 for (auto& layer : *layers_) |
2113 layer->ResetChangeTracking(); | 1997 layer->ResetChangeTracking(); |
2114 property_trees_.ResetAllChangeTracking(); | 1998 property_trees_.ResetAllChangeTracking(); |
2115 } | 1999 } |
2116 | 2000 |
2117 } // namespace cc | 2001 } // namespace cc |
OLD | NEW |