diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 14:44:19 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 14:44:19 +0000 |
commit | b4db93705d370c3e7d7964c114a6ac51bea635f0 (patch) | |
tree | d9d6509e212e5c97278225588984f396704545be /ui/gfx/compositor/layer.cc | |
parent | 3c521f7ca5d09cba6153967e61e6327df0204b02 (diff) | |
download | chromium_src-b4db93705d370c3e7d7964c114a6ac51bea635f0.zip chromium_src-b4db93705d370c3e7d7964c114a6ac51bea635f0.tar.gz chromium_src-b4db93705d370c3e7d7964c114a6ac51bea635f0.tar.bz2 |
Explicit animation support
High level description:
- LayerPropertySetter is now LayerAnimator since it manages implicit/explicit animations and the animation queue.
- LayerAnimationElement represents an animation curve.
- LayerAnimationSequence owns a collection of elements.
- The animator works as follows:
o Has a queue of sequences and a collection of running sequences.
o It knows the start time of each running sequence.
o While there are running sequences, LayerAnimator::Step(base::TimeTicks now) is called periodically, and each of the running sequences are updated.
BUG=None
TEST=compositor_unittests, base_unittests
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=106768
Review URL: http://codereview.chromium.org/8247009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/compositor/layer.cc')
-rw-r--r-- | ui/gfx/compositor/layer.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc index 1a42754..91c3199 100644 --- a/ui/gfx/compositor/layer.cc +++ b/ui/gfx/compositor/layer.cc @@ -12,7 +12,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFloatRect.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" #include "ui/base/animation/animation.h" -#include "ui/gfx/compositor/layer_animator.h" +#include "ui/gfx/compositor/layer_animation_manager.h" #include "ui/gfx/canvas_skia.h" #include "ui/gfx/interpolated_transform.h" #include "ui/gfx/point3.h" @@ -131,7 +131,7 @@ bool Layer::Contains(const Layer* other) const { void Layer::SetAnimation(Animation* animation) { if (animation) { if (!animator_.get()) - animator_.reset(new LayerAnimator(this)); + animator_.reset(new LayerAnimationManager(this)); animation->Start(); animator_->SetAnimation(animation); } else { @@ -140,7 +140,7 @@ void Layer::SetAnimation(Animation* animation) { } void Layer::SetTransform(const ui::Transform& transform) { - StopAnimatingIfNecessary(LayerAnimator::TRANSFORM); + StopAnimatingIfNecessary(LayerAnimationManager::TRANSFORM); if (animator_.get() && animator_->IsRunning()) { animator_->AnimateTransform(transform); return; @@ -149,7 +149,7 @@ void Layer::SetTransform(const ui::Transform& transform) { } void Layer::SetBounds(const gfx::Rect& bounds) { - StopAnimatingIfNecessary(LayerAnimator::LOCATION); + StopAnimatingIfNecessary(LayerAnimationManager::LOCATION); if (animator_.get() && animator_->IsRunning() && bounds.size() == bounds_.size()) { animator_->AnimateToPoint(bounds.origin()); @@ -165,7 +165,7 @@ gfx::Rect Layer::GetTargetBounds() const { } void Layer::SetOpacity(float opacity) { - StopAnimatingIfNecessary(LayerAnimator::OPACITY); + StopAnimatingIfNecessary(LayerAnimationManager::OPACITY); if (animator_.get() && animator_->IsRunning()) { animator_->AnimateOpacity(opacity); return; @@ -515,23 +515,23 @@ bool Layer::GetTransformRelativeTo(const Layer* ancestor, } void Layer::StopAnimatingIfNecessary( - LayerAnimator::AnimationProperty property) { + LayerAnimationManager::AnimationProperty property) { if (!animator_.get() || !animator_->IsRunning() || !animator_->got_initial_tick()) { return; } - if (property != LayerAnimator::LOCATION && - animator_->IsAnimating(LayerAnimator::LOCATION)) { + if (property != LayerAnimationManager::LOCATION && + animator_->IsAnimating(LayerAnimationManager::LOCATION)) { SetBoundsImmediately( gfx::Rect(animator_->GetTargetPoint(), bounds_.size())); } - if (property != LayerAnimator::OPACITY && - animator_->IsAnimating(LayerAnimator::OPACITY)) { + if (property != LayerAnimationManager::OPACITY && + animator_->IsAnimating(LayerAnimationManager::OPACITY)) { SetOpacityImmediately(animator_->GetTargetOpacity()); } - if (property != LayerAnimator::TRANSFORM && - animator_->IsAnimating(LayerAnimator::TRANSFORM)) { + if (property != LayerAnimationManager::TRANSFORM && + animator_->IsAnimating(LayerAnimationManager::TRANSFORM)) { SetTransformImmediately(animator_->GetTargetTransform()); } animator_.reset(); |