Adds LayerAnimator::SchedulePauseForProperties().
BUG=none
TEST=covered by unit tests
[email protected]
Review URL: https://chromiumcodereview.appspot.com/10910074
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154843 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index a0d904c..fbb298ad 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -217,6 +217,23 @@
UpdateAnimationState();
}
+void LayerAnimator::SchedulePauseForProperties(
+ base::TimeDelta duration,
+ LayerAnimationElement::AnimatableProperty property,
+ ...) {
+ ui::LayerAnimationElement::AnimatableProperties properties_to_pause;
+ va_list marker;
+ va_start(marker, property);
+ for (int p = static_cast<int>(property); p != -1; p = va_arg(marker, int)) {
+ properties_to_pause.insert(
+ static_cast<LayerAnimationElement::AnimatableProperty>(p));
+ }
+ va_end(marker);
+ ScheduleAnimation(new ui::LayerAnimationSequence(
+ ui::LayerAnimationElement::CreatePauseElement(
+ properties_to_pause, duration)));
+}
+
bool LayerAnimator::IsAnimatingProperty(
LayerAnimationElement::AnimatableProperty property) const {
for (AnimationQueue::const_iterator queue_iter = animation_queue_.begin();