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

Unified Diff: ui/compositor/layer.cc

Issue 1531913003: CC Animations: Make ui::LayerAnimator a LayerAnimationEventObserver (instead of ui::Layer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerAnimator::SetDelegate Created 5 years 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_animation_delegate.h » ('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 aa46790f24f7994152cb0cc0c4fe04f630f11bf6..8f8672803103a14aae82d4e153bd7696ae4f8f72 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -120,7 +120,6 @@ Layer::~Layer() {
for (size_t i = 0; i < children_.size(); ++i)
children_[i]->parent_ = NULL;
- cc_layer_->RemoveLayerAnimationEventObserver(this);
cc_layer_->RemoveFromParent();
}
@@ -488,6 +487,7 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
if (animator_.get()) {
animator_->StopAnimatingProperty(LayerAnimationElement::TRANSFORM);
animator_->StopAnimatingProperty(LayerAnimationElement::OPACITY);
+ animator_->SwitchToLayer(new_layer);
}
if (texture_layer_.get())
@@ -499,7 +499,6 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
cc_layer_->parent()->ReplaceChild(cc_layer_, new_layer);
}
cc_layer_->SetLayerClient(NULL);
- cc_layer_->RemoveLayerAnimationEventObserver(this);
new_layer->SetOpacity(cc_layer_->opacity());
new_layer->SetTransform(cc_layer_->transform());
new_layer->SetPosition(cc_layer_->position());
@@ -512,7 +511,6 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
delegated_renderer_layer_ = NULL;
surface_layer_ = NULL;
- cc_layer_->AddLayerAnimationEventObserver(this);
for (size_t i = 0; i < children_.size(); ++i) {
DCHECK(children_[i]->cc_layer_);
cc_layer_->AddChild(children_[i]->cc_layer_);
@@ -819,11 +817,6 @@ scoped_refptr<base::trace_event::ConvertableToTraceFormat> Layer::TakeDebugInfo(
return new LayerDebugInfo(name_);
}
-void Layer::OnAnimationStarted(const cc::AnimationEvent& event) {
- if (animator_.get())
- animator_->OnThreadedAnimationStarted(event);
-}
-
void Layer::CollectAnimators(
std::vector<scoped_refptr<LayerAnimator>>* animators) {
if (IsAnimating())
@@ -1007,6 +1000,10 @@ LayerAnimatorCollection* Layer::GetLayerAnimatorCollection() {
return compositor ? compositor->layer_animator_collection() : NULL;
}
+cc::Layer* Layer::GetCcLayer() const {
+ return cc_layer_;
+}
+
void Layer::SendPendingThreadedAnimations() {
for (auto& animation : pending_threaded_animations_)
cc_layer_->AddAnimation(std::move(animation));
@@ -1030,7 +1027,6 @@ void Layer::CreateCcLayer() {
cc_layer_->SetTransformOrigin(gfx::Point3F());
cc_layer_->SetContentsOpaque(true);
cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
- cc_layer_->AddLayerAnimationEventObserver(this);
cc_layer_->SetLayerClient(this);
RecomputePosition();
}
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_animation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698