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

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

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. 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_animator.cc
diff --git a/ui/gfx/compositor/layer_animator.cc b/ui/gfx/compositor/layer_animator.cc
index e737377c86c600ca0674470eba190fc75b18ee7f..2da478ea38e4c2440951d795058eadf8ecd4e7d1 100644
--- a/ui/gfx/compositor/layer_animator.cc
+++ b/ui/gfx/compositor/layer_animator.cc
@@ -60,6 +60,12 @@ void LayerAnimator::SetTransform(const Transform& transform) {
transition_duration_)));
}
+Transform LayerAnimator::GetTargetTransform() const {
+ LayerAnimationElement::TargetValue target;
+ GetTargetValue(&target);
+ return target.transform;
+}
+
void LayerAnimator::SetBounds(const gfx::Rect& bounds) {
if (transition_duration_ == base::TimeDelta())
delegate_->SetBoundsFromAnimation(bounds);
@@ -69,6 +75,12 @@ void LayerAnimator::SetBounds(const gfx::Rect& bounds) {
transition_duration_)));
}
+gfx::Rect LayerAnimator::GetTargetBounds() const {
+ LayerAnimationElement::TargetValue target;
+ GetTargetValue(&target);
+ return target.bounds;
+}
+
void LayerAnimator::SetOpacity(float opacity) {
if (transition_duration_ == base::TimeDelta())
delegate_->SetOpacityFromAnimation(opacity);
@@ -78,6 +90,12 @@ void LayerAnimator::SetOpacity(float opacity) {
transition_duration_)));
}
+float LayerAnimator::GetTargetOpacity() const {
+ LayerAnimationElement::TargetValue target;
+ GetTargetValue(&target);
+ return target.opacity;
+}
+
void LayerAnimator::SetDelegate(LayerAnimationDelegate* delegate) {
DCHECK(delegate);
delegate_ = delegate;
@@ -440,4 +458,17 @@ bool LayerAnimator::StartSequenceImmediately(LayerAnimationSequence* sequence) {
return true;
}
+void LayerAnimator::GetTargetValue(
+ LayerAnimationElement::TargetValue* target) const {
+ for (RunningAnimations::const_iterator iter = running_animations_.begin();
+ iter != running_animations_.end(); ++iter) {
+ (*iter).sequence->GetTargetValue(target);
+ }
+
+ for (AnimationQueue::const_iterator iter = animation_queue_.begin();
+ iter != animation_queue_.end(); ++iter) {
+ (*iter)->GetTargetValue(target);
+ }
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698