| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 "Inverse supported only for single element sequences."; | 60 "Inverse supported only for single element sequences."; |
| 61 | 61 |
| 62 LayerAnimationElement* element = sequence->FirstElement(); | 62 LayerAnimationElement* element = sequence->FirstElement(); |
| 63 DCHECK_EQ(static_cast<LayerAnimationElement::AnimatableProperties>( | 63 DCHECK_EQ(static_cast<LayerAnimationElement::AnimatableProperties>( |
| 64 LayerAnimationElement::TRANSFORM), | 64 LayerAnimationElement::TRANSFORM), |
| 65 element->properties()) | 65 element->properties()) |
| 66 << "Only transform animations are currently invertible."; | 66 << "Only transform animations are currently invertible."; |
| 67 | 67 |
| 68 scoped_ptr<LayerAnimationElement> to_return( | 68 scoped_ptr<LayerAnimationElement> to_return( |
| 69 LayerAnimationElement::CreateInverseTransformElement(base, element)); | 69 LayerAnimationElement::CreateInverseTransformElement(base, element)); |
| 70 return to_return.Pass(); | 70 return to_return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 Layer* base_layer_; | 73 Layer* base_layer_; |
| 74 // child layers | 74 // child layers |
| 75 std::vector<Layer*> inverse_layers_; | 75 std::vector<Layer*> inverse_layers_; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 | 78 |
| 79 // ScopedLayerAnimationSettings ------------------------------------------------ | 79 // ScopedLayerAnimationSettings ------------------------------------------------ |
| 80 ScopedLayerAnimationSettings::ScopedLayerAnimationSettings( | 80 ScopedLayerAnimationSettings::ScopedLayerAnimationSettings( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 inverse_observer_->SetLayer(base); | 154 inverse_observer_->SetLayer(base); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void ScopedLayerAnimationSettings::AddInverselyAnimatedLayer( | 157 void ScopedLayerAnimationSettings::AddInverselyAnimatedLayer( |
| 158 Layer* inverse_layer) { | 158 Layer* inverse_layer) { |
| 159 inverse_observer_->AddInverselyAnimatedLayer(inverse_layer); | 159 inverse_observer_->AddInverselyAnimatedLayer(inverse_layer); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace ui | 162 } // namespace ui |
| OLD | NEW |