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

Unified Diff: ui/gfx/compositor/layer.cc

Issue 8247009: Explicit animation support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/compositor/layer.cc
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
index 8266bffc684f000fea7878179f3e821b8847f926..1087ab50a4526bb3d20b468d92d2e95482488ba4 100644
--- a/ui/gfx/compositor/layer.cc
+++ b/ui/gfx/compositor/layer.cc
@@ -9,7 +9,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.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"
@@ -109,7 +109,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 {
@@ -118,7 +118,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;
@@ -127,7 +127,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());
@@ -137,7 +137,7 @@ void Layer::SetBounds(const gfx::Rect& bounds) {
}
void Layer::SetOpacity(float opacity) {
- StopAnimatingIfNecessary(LayerAnimator::OPACITY);
+ StopAnimatingIfNecessary(LayerAnimationManager::OPACITY);
if (animator_.get() && animator_->IsRunning()) {
animator_->AnimateOpacity(opacity);
return;
@@ -433,23 +433,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();

Powered by Google App Engine
This is Rietveld 408576698