| 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_sequence.h" | 5 #include "ui/compositor/layer_animation_sequence.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 waiting_for_group_start_ = false; | 166 waiting_for_group_start_ = false; |
| 167 NotifyAborted(); | 167 NotifyAborted(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void LayerAnimationSequence::AddElement(LayerAnimationElement* element) { | 170 void LayerAnimationSequence::AddElement(LayerAnimationElement* element) { |
| 171 properties_.insert(element->properties().begin(), | 171 properties_.insert(element->properties().begin(), |
| 172 element->properties().end()); | 172 element->properties().end()); |
| 173 elements_.push_back(make_linked_ptr(element)); | 173 elements_.push_back(make_linked_ptr(element)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool LayerAnimationSequence::HasCommonProperty( | 176 bool LayerAnimationSequence::HasConflictingProperty( |
| 177 const LayerAnimationElement::AnimatableProperties& other) const { | 177 const LayerAnimationElement::AnimatableProperties& other) const { |
| 178 LayerAnimationElement::AnimatableProperties intersection; | 178 LayerAnimationElement::AnimatableProperties intersection; |
| 179 std::insert_iterator<LayerAnimationElement::AnimatableProperties> ii( | 179 std::insert_iterator<LayerAnimationElement::AnimatableProperties> ii( |
| 180 intersection, intersection.begin()); | 180 intersection, intersection.begin()); |
| 181 std::set_intersection(properties_.begin(), properties_.end(), | 181 std::set_intersection(properties_.begin(), properties_.end(), |
| 182 other.begin(), other.end(), | 182 other.begin(), other.end(), |
| 183 ii); | 183 ii); |
| 184 return intersection.size() > 0; | 184 if (intersection.size() > 0) |
| 185 return true; |
| 186 |
| 187 if (properties_.find(LayerAnimationElement::TRANSFORM) != properties_.end() && |
| 188 other.find(LayerAnimationElement::BOUNDS) != other.end()) |
| 189 return true; |
| 190 |
| 191 if (properties_.find(LayerAnimationElement::BOUNDS) != properties_.end() && |
| 192 other.find(LayerAnimationElement::TRANSFORM) != other.end()) |
| 193 return true; |
| 194 |
| 195 return false; |
| 185 } | 196 } |
| 186 | 197 |
| 187 bool LayerAnimationSequence::IsFirstElementThreaded() const { | 198 bool LayerAnimationSequence::IsFirstElementThreaded() const { |
| 188 if (!elements_.empty()) | 199 if (!elements_.empty()) |
| 189 return elements_[0]->IsThreaded(); | 200 return elements_[0]->IsThreaded(); |
| 190 | 201 |
| 191 return false; | 202 return false; |
| 192 } | 203 } |
| 193 | 204 |
| 194 void LayerAnimationSequence::AddObserver(LayerAnimationObserver* observer) { | 205 void LayerAnimationSequence::AddObserver(LayerAnimationObserver* observer) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 OnLayerAnimationEnded(this)); | 260 OnLayerAnimationEnded(this)); |
| 250 } | 261 } |
| 251 | 262 |
| 252 void LayerAnimationSequence::NotifyAborted() { | 263 void LayerAnimationSequence::NotifyAborted() { |
| 253 FOR_EACH_OBSERVER(LayerAnimationObserver, | 264 FOR_EACH_OBSERVER(LayerAnimationObserver, |
| 254 observers_, | 265 observers_, |
| 255 OnLayerAnimationAborted(this)); | 266 OnLayerAnimationAborted(this)); |
| 256 } | 267 } |
| 257 | 268 |
| 258 } // namespace ui | 269 } // namespace ui |
| OLD | NEW |