cc: remove TransferAnimationsTo dead code

After removing m_transformLayer from Blink's GraphicsLayer class,
TransferAnimationsTo is now dead code that can be removed. The WebLayer API
declaration is in Blink and will be removed in a follow-up patch.

BUG=245520

Review URL: https://chromiumcodereview.appspot.com/15896030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204090 0039d316-1c4b-4281-b951-d872f2087c98
parent 314b4884
......@@ -130,17 +130,6 @@ void LayerAnimationController::PushAnimationUpdatesTo(
UpdateActivation(NormalActivation);
}
void LayerAnimationController::TransferAnimationsTo(
LayerAnimationController* other_controller) {
other_controller->active_animations_.clear();
active_animations_.swap(other_controller->active_animations_);
UpdateActivation(NormalActivation);
set_force_sync();
other_controller->UpdateActivation(NormalActivation);
other_controller->set_force_sync();
other_controller->SetAnimationRegistrar(registrar_);
}
void LayerAnimationController::Animate(double monotonic_time) {
if (!HasValueObserver())
return;
......
......@@ -52,14 +52,6 @@ class CC_EXPORT LayerAnimationController
virtual void PushAnimationUpdatesTo(
LayerAnimationController* controller_impl);
// Transfers ownership of all animations to other_controller, replacing
// any animations currently owned by other_controller. This is intended
// to be used for transferring animations between main thread controllers,
// so the run state of each transferred animation is preserved (note that
// this differs from ReplaceImplThreadAnimations, which is used for copying
// animations from a main thread controller to an impl thread controller).
void TransferAnimationsTo(LayerAnimationController* other_controller);
void Animate(double monotonic_time);
void AccumulatePropertyUpdates(double monotonic_time,
AnimationEventsVector* events);
......
......@@ -248,45 +248,6 @@ TEST(LayerAnimationControllerTest, AnimationsAreDeleted) {
EXPECT_FALSE(controller_impl->has_any_animation());
}
TEST(LayerAnimationControllerTest, TransferAnimationsTo) {
FakeLayerAnimationValueObserver dummy;
scoped_refptr<LayerAnimationController> controller(
LayerAnimationController::Create(0));
scoped_refptr<LayerAnimationController> other_controller(
LayerAnimationController::Create(1));
controller->AddValueObserver(&dummy);
int opacity_animation_id = AddOpacityTransitionToController(
controller.get(), 1.0, 0.0f, 1.0f, false);
int transform_animation_id =
AddAnimatedTransformToController(controller.get(), 1.0, 10, 10);
controller->Animate(1.0);
// Both animations should now be Starting.
EXPECT_EQ(Animation::Starting,
controller->GetAnimation(Animation::Opacity)->run_state());
EXPECT_EQ(Animation::Starting,
controller->GetAnimation(Animation::Transform)->run_state());
controller->TransferAnimationsTo(other_controller.get());
// Ensure both animations have been transfered.
EXPECT_FALSE(controller->has_any_animation());
EXPECT_EQ(other_controller->GetAnimation(Animation::Opacity)->id(),
opacity_animation_id);
EXPECT_EQ(other_controller->GetAnimation(Animation::Transform)->id(),
transform_animation_id);
// Ensure that the run state of the transferred animations has been
// preserved.
EXPECT_EQ(Animation::Starting,
other_controller->GetAnimation(Animation::Opacity)->run_state());
EXPECT_EQ(Animation::Starting,
other_controller->GetAnimation(Animation::Transform)->run_state());
}
// Tests that transitioning opacity from 0 to 1 works as expected.
static const AnimationEvent* GetMostRecentPropertyUpdateEvent(
......
......@@ -825,11 +825,6 @@ void Layer::RemoveAnimation(int animation_id) {
SetNeedsCommit();
}
void Layer::TransferAnimationsTo(Layer* layer) {
layer_animation_controller_->TransferAnimationsTo(
layer->layer_animation_controller());
}
void Layer::SuspendAnimations(double monotonic_time) {
layer_animation_controller_->SuspendAnimations(monotonic_time);
SetNeedsCommit();
......
......@@ -321,8 +321,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
void PauseAnimation(int animation_id, double time_offset);
void RemoveAnimation(int animation_id);
void TransferAnimationsTo(Layer* layer);
void SuspendAnimations(double monotonic_time);
void ResumeAnimations(double monotonic_time);
......
......@@ -211,11 +211,6 @@ void WebLayerImpl::resumeAnimations(double monotonic_time) {
bool WebLayerImpl::hasActiveAnimation() { return layer_->HasActiveAnimation(); }
void WebLayerImpl::transferAnimationsTo(WebLayer* other) {
DCHECK(other);
layer_->TransferAnimationsTo(static_cast<WebLayerImpl*>(other)->layer_.get());
}
void WebLayerImpl::setForceRenderSurface(bool force_render_surface) {
layer_->SetForceRenderSurface(force_render_surface);
}
......
......@@ -92,7 +92,6 @@ class WebLayerImpl : public WebKit::WebLayer {
virtual void suspendAnimations(double monotonic_time);
virtual void resumeAnimations(double monotonic_time);
virtual bool hasActiveAnimation();
virtual void transferAnimationsTo(WebKit::WebLayer* layer);
virtual void setForceRenderSurface(bool force);
virtual void setScrollPosition(WebKit::WebPoint position);
virtual WebKit::WebPoint scrollPosition() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment