Index: ui/compositor/layer.cc |
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
index 81e23b49ee7d3c98741125c9e40e627e00e74e48..7a00bbdd7a34e31156a08d107a3c6fad7b8139fa 100644 |
--- a/ui/compositor/layer.cc |
+++ b/ui/compositor/layer.cc |
@@ -431,6 +431,12 @@ void Layer::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { |
} |
void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) { |
+ // Finish animations being handled by cc_layer_. |
+ if (animator_) { |
+ animator_->StopAnimatingProperty(LayerAnimationElement::TRANSFORM); |
+ animator_->StopAnimatingProperty(LayerAnimationElement::OPACITY); |
+ } |
+ |
if (texture_layer_.get()) |
texture_layer_->WillModifyTexture(); |
// TODO(piman): delegated_renderer_layer_ cleanup. |
@@ -461,6 +467,12 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) { |
cc_layer_->SetIsDrawable(IsDrawn()); |
} |
+void Layer::SwitchCCLayerForTest() { |
+ scoped_refptr<cc::ContentLayer> new_layer = cc::ContentLayer::Create(this); |
+ SwitchToLayer(new_layer); |
+ content_layer_ = new_layer; |
+} |
+ |
void Layer::SetExternalTexture(Texture* texture) { |
DCHECK_EQ(type_, LAYER_TEXTURED); |
DCHECK(!solid_color_layer_); |