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 |