| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/scoped_layer_animation_settings.h" | 5 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 6 | 6 |
| 7 #include "ui/compositor/layer.h" | 7 #include "ui/compositor/layer.h" |
| 8 #include "ui/compositor/layer_animation_observer.h" | 8 #include "ui/compositor/layer_animation_observer.h" |
| 9 #include "ui/compositor/layer_animation_sequence.h" | 9 #include "ui/compositor/layer_animation_sequence.h" |
| 10 #include "ui/compositor/layer_animator.h" | 10 #include "ui/compositor/layer_animator.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 virtual ~InvertingObserver() {} | 27 virtual ~InvertingObserver() {} |
| 28 | 28 |
| 29 void SetLayer(Layer* base_layer) { base_layer_ = base_layer; } | 29 void SetLayer(Layer* base_layer) { base_layer_ = base_layer; } |
| 30 | 30 |
| 31 Layer* layer() { return base_layer_; } | 31 Layer* layer() { return base_layer_; } |
| 32 | 32 |
| 33 void AddInverselyAnimatedLayer(Layer* inverse_layer) { | 33 void AddInverselyAnimatedLayer(Layer* inverse_layer) { |
| 34 inverse_layers_.push_back(inverse_layer); | 34 inverse_layers_.push_back(inverse_layer); |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual void OnImplicitAnimationsCompleted() OVERRIDE {} | 37 virtual void OnImplicitAnimationsCompleted() override {} |
| 38 | 38 |
| 39 virtual void OnLayerAnimationScheduled( | 39 virtual void OnLayerAnimationScheduled( |
| 40 LayerAnimationSequence* sequence) OVERRIDE { | 40 LayerAnimationSequence* sequence) override { |
| 41 DCHECK(base_layer_ != NULL) | 41 DCHECK(base_layer_ != NULL) |
| 42 << "Must set base layer with ScopedLayerAnimationSettings::" | 42 << "Must set base layer with ScopedLayerAnimationSettings::" |
| 43 << "SetInverslyAnimatedBaseLayer"; | 43 << "SetInverslyAnimatedBaseLayer"; |
| 44 gfx::Transform base_transform = base_layer_->transform(); | 44 gfx::Transform base_transform = base_layer_->transform(); |
| 45 scoped_ptr<LayerAnimationElement> inverse = GetInverseElement(sequence, | 45 scoped_ptr<LayerAnimationElement> inverse = GetInverseElement(sequence, |
| 46 base_transform); | 46 base_transform); |
| 47 | 47 |
| 48 for (std::vector<Layer*>::const_iterator i = | 48 for (std::vector<Layer*>::const_iterator i = |
| 49 inverse_layers_.begin(); i != inverse_layers_.end(); ++i) { | 49 inverse_layers_.begin(); i != inverse_layers_.end(); ++i) { |
| 50 (*i)->GetAnimator()->StartAnimation(new LayerAnimationSequence( | 50 (*i)->GetAnimator()->StartAnimation(new LayerAnimationSequence( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 inverse_observer_->SetLayer(base); | 155 inverse_observer_->SetLayer(base); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void ScopedLayerAnimationSettings::AddInverselyAnimatedLayer( | 158 void ScopedLayerAnimationSettings::AddInverselyAnimatedLayer( |
| 159 Layer* inverse_layer) { | 159 Layer* inverse_layer) { |
| 160 inverse_observer_->AddInverselyAnimatedLayer(inverse_layer); | 160 inverse_observer_->AddInverselyAnimatedLayer(inverse_layer); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace ui | 163 } // namespace ui |
| OLD | NEW |