Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: ui/compositor/layer.cc

Issue 12609006: ui::Layer::SwitchToLayer should finish animations on its old cc::Layer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698