Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 1010663002: CC Animations: Redirect all compositor animation requests to AnimationHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@introduce
Patch Set: Add ported unittests. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 void LayerTreeImpl::SetPendingPageScaleAnimation( 1570 void LayerTreeImpl::SetPendingPageScaleAnimation(
1570 scoped_ptr<PendingPageScaleAnimation> pending_animation) { 1571 scoped_ptr<PendingPageScaleAnimation> pending_animation) {
1571 pending_page_scale_animation_ = pending_animation.Pass(); 1572 pending_page_scale_animation_ = pending_animation.Pass();
1572 } 1573 }
1573 1574
1574 scoped_ptr<PendingPageScaleAnimation> 1575 scoped_ptr<PendingPageScaleAnimation>
1575 LayerTreeImpl::TakePendingPageScaleAnimation() { 1576 LayerTreeImpl::TakePendingPageScaleAnimation() {
1576 return pending_page_scale_animation_.Pass(); 1577 return pending_page_scale_animation_.Pass();
1577 } 1578 }
1578 1579
1580 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const {
1581 return layer_tree_host_impl_->animation_host()
1582 ? layer_tree_host_impl_->animation_host()
1583 ->IsAnimatingFilterProperty(layer->id())
1584 : false;
1585 }
1586
1587 bool LayerTreeImpl::IsAnimatingOpacityProperty(const LayerImpl* layer) const {
1588 return layer_tree_host_impl_->animation_host()
1589 ? layer_tree_host_impl_->animation_host()
1590 ->IsAnimatingOpacityProperty(layer->id())
1591 : false;
1592 }
1593
1594 bool LayerTreeImpl::IsAnimatingTransformProperty(const LayerImpl* layer) const {
1595 return layer_tree_host_impl_->animation_host()
1596 ? layer_tree_host_impl_->animation_host()
1597 ->IsAnimatingTransformProperty(layer->id())
1598 : false;
1599 }
1600
1601 bool LayerTreeImpl::FilterIsAnimatingOnImplOnly(const LayerImpl* layer) const {
1602 return layer_tree_host_impl_->animation_host()
1603 ? layer_tree_host_impl_->animation_host()
1604 ->FilterIsAnimatingOnImplOnly(layer->id())
1605 : false;
1606 }
1607
1608 bool LayerTreeImpl::OpacityIsAnimatingOnImplOnly(const LayerImpl* layer) const {
1609 return layer_tree_host_impl_->animation_host()
1610 ? layer_tree_host_impl_->animation_host()
1611 ->OpacityIsAnimatingOnImplOnly(layer->id())
1612 : false;
1613 }
1614
1615 bool LayerTreeImpl::TransformIsAnimatingOnImplOnly(
1616 const LayerImpl* layer) const {
1617 return layer_tree_host_impl_->animation_host()
1618 ? layer_tree_host_impl_->animation_host()
1619 ->TransformIsAnimatingOnImplOnly(layer->id())
1620 : false;
1621 }
1622
1623 bool LayerTreeImpl::HasOnlyTranslationTransforms(const LayerImpl* layer) const {
1624 return layer_tree_host_impl_->animation_host()
1625 ? layer_tree_host_impl_->animation_host()
1626 ->HasOnlyTranslationTransforms(layer->id())
1627 : true;
1628 }
1629
1630 bool LayerTreeImpl::MaximumTargetScale(const LayerImpl* layer,
1631 float* max_scale) const {
1632 *max_scale = 0.f;
1633 return layer_tree_host_impl_->animation_host()
1634 ? layer_tree_host_impl_->animation_host()->MaximumTargetScale(
1635 layer->id(), max_scale)
1636 : true;
1637 }
1638
1639 bool LayerTreeImpl::HasFilterAnimationThatInflatesBounds(
1640 const LayerImpl* layer) const {
1641 return layer_tree_host_impl_->animation_host()
1642 ? layer_tree_host_impl_->animation_host()
1643 ->HasFilterAnimationThatInflatesBounds(layer->id())
1644 : false;
1645 }
1646
1647 bool LayerTreeImpl::HasTransformAnimationThatInflatesBounds(
1648 const LayerImpl* layer) const {
1649 return layer_tree_host_impl_->animation_host()
1650 ? layer_tree_host_impl_->animation_host()
1651 ->HasTransformAnimationThatInflatesBounds(layer->id())
1652 : false;
1653 }
1654
1655 bool LayerTreeImpl::HasAnimationThatInflatesBounds(
1656 const LayerImpl* layer) const {
1657 return layer_tree_host_impl_->animation_host()
1658 ? layer_tree_host_impl_->animation_host()
1659 ->HasAnimationThatInflatesBounds(layer->id())
1660 : false;
1661 }
1662
1663 bool LayerTreeImpl::FilterAnimationBoundsForBox(const LayerImpl* layer,
1664 const gfx::BoxF& box,
1665 gfx::BoxF* bounds) const {
1666 return layer_tree_host_impl_->animation_host()
1667 ? layer_tree_host_impl_->animation_host()
1668 ->FilterAnimationBoundsForBox(layer->id(), box, bounds)
1669 : false;
1670 }
1671
1672 bool LayerTreeImpl::TransformAnimationBoundsForBox(const LayerImpl* layer,
1673 const gfx::BoxF& box,
1674 gfx::BoxF* bounds) const {
1675 *bounds = gfx::BoxF();
1676 return layer_tree_host_impl_->animation_host()
1677 ? layer_tree_host_impl_->animation_host()
1678 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
1679 : true;
1680 }
1681
1579 } // namespace cc 1682 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698