| Index: ui/compositor/test/layer_animator_test_controller.cc
|
| diff --git a/ui/compositor/test/layer_animator_test_controller.cc b/ui/compositor/test/layer_animator_test_controller.cc
|
| index 5721cceae8cbe8884c9cc47f6c1691c6d1b06042..3b131acba4c54fbd9d439ed1e2b1f7e8daf4763d 100644
|
| --- a/ui/compositor/test/layer_animator_test_controller.cc
|
| +++ b/ui/compositor/test/layer_animator_test_controller.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "cc/animation.h"
|
| #include "ui/compositor/test/layer_animator_test_controller.h"
|
| #include "ui/compositor/layer_animation_sequence.h"
|
|
|
| @@ -26,27 +27,33 @@ LayerAnimationSequence* LayerAnimatorTestController::GetRunningSequence(
|
| }
|
|
|
| void LayerAnimatorTestController::StartThreadedAnimationsIfNeeded() {
|
| - LayerAnimationSequence* sequence =
|
| - GetRunningSequence(LayerAnimationElement::OPACITY);
|
| -
|
| - if (!sequence)
|
| - return;
|
| -
|
| - LayerAnimationElement* element = sequence->CurrentElement();
|
| - if (element->properties().find(LayerAnimationElement::OPACITY) ==
|
| - element->properties().end())
|
| - return;
|
| -
|
| - if (!element->Started() ||
|
| - element->effective_start_time() != base::TimeTicks())
|
| - return;
|
| -
|
| - animator_->OnThreadedAnimationStarted(cc::AnimationEvent(
|
| - cc::AnimationEvent::Started,
|
| - 0,
|
| - element->animation_group_id(),
|
| - cc::Animation::Opacity,
|
| - (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF()));
|
| + std::vector<cc::Animation::TargetProperty> threaded_properties;
|
| + threaded_properties.push_back(cc::Animation::Opacity);
|
| + threaded_properties.push_back(cc::Animation::Transform);
|
| +
|
| + for (size_t i = 0; i < threaded_properties.size(); i++) {
|
| + LayerAnimationElement::AnimatableProperty animatable_property =
|
| + LayerAnimationElement::ToAnimatableProperty(threaded_properties[i]);
|
| + LayerAnimationSequence* sequence = GetRunningSequence(animatable_property);
|
| + if (!sequence)
|
| + continue;
|
| +
|
| + LayerAnimationElement* element = sequence->CurrentElement();
|
| + if (element->properties().find(animatable_property) ==
|
| + element->properties().end())
|
| + continue;
|
| +
|
| + if (!element->Started() ||
|
| + element->effective_start_time() != base::TimeTicks())
|
| + continue;
|
| +
|
| + animator_->OnThreadedAnimationStarted(cc::AnimationEvent(
|
| + cc::AnimationEvent::Started,
|
| + 0,
|
| + element->animation_group_id(),
|
| + threaded_properties[i],
|
| + (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF()));
|
| + }
|
| }
|
|
|
| } // namespace ui
|
|
|