| 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/layer_animation_observer.h" | 5 #include "ui/compositor/layer_animation_observer.h" |
| 6 | 6 |
| 7 #include "ui/compositor/layer_animation_sequence.h" | 7 #include "ui/compositor/layer_animation_sequence.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 void ImplicitAnimationObserver::CheckCompleted() { | 133 void ImplicitAnimationObserver::CheckCompleted() { |
| 134 if (active_ && attached_sequences().empty()) { | 134 if (active_ && attached_sequences().empty()) { |
| 135 active_ = false; | 135 active_ = false; |
| 136 OnImplicitAnimationsCompleted(); | 136 OnImplicitAnimationsCompleted(); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 void ImplicitAnimationObserver::UpdatePropertyAnimationStatus( | 140 void ImplicitAnimationObserver::UpdatePropertyAnimationStatus( |
| 141 LayerAnimationSequence* sequence, | 141 LayerAnimationSequence* sequence, |
| 142 AnimationStatus status) { | 142 AnimationStatus status) { |
| 143 const LayerAnimationElement::AnimatableProperties& properties = | 143 LayerAnimationElement::AnimatableProperties properties = |
| 144 sequence->properties(); | 144 sequence->properties(); |
| 145 for (LayerAnimationElement::AnimatableProperties::const_iterator i = | 145 for (unsigned i = LayerAnimationElement::FIRST_PROPERTY; |
| 146 properties.begin(); i != properties.end(); ++i) { | 146 i != LayerAnimationElement::SENTINEL; |
| 147 property_animation_status_[(*i)] = status; | 147 i = i << 1) { |
| 148 if (i & properties) { |
| 149 LayerAnimationElement::AnimatableProperty property = |
| 150 static_cast<LayerAnimationElement::AnimatableProperty>(i); |
| 151 property_animation_status_[property] = status; |
| 152 } |
| 148 } | 153 } |
| 149 } | 154 } |
| 150 | 155 |
| 151 ImplicitAnimationObserver::AnimationStatus | 156 ImplicitAnimationObserver::AnimationStatus |
| 152 ImplicitAnimationObserver::AnimationStatusForProperty( | 157 ImplicitAnimationObserver::AnimationStatusForProperty( |
| 153 LayerAnimationElement::AnimatableProperty property) const { | 158 LayerAnimationElement::AnimatableProperty property) const { |
| 154 PropertyAnimationStatusMap::const_iterator iter = | 159 PropertyAnimationStatusMap::const_iterator iter = |
| 155 property_animation_status_.find(property); | 160 property_animation_status_.find(property); |
| 156 return iter == property_animation_status_.end() ? ANIMATION_STATUS_UNKNOWN : | 161 return iter == property_animation_status_.end() ? ANIMATION_STATUS_UNKNOWN : |
| 157 iter->second; | 162 iter->second; |
| 158 } | 163 } |
| 159 | 164 |
| 160 } // namespace ui | 165 } // namespace ui |
| OLD | NEW |