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/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 size_t current_index = last_element_ % elements_.size(); | 175 size_t current_index = last_element_ % elements_.size(); |
176 while (current_index < elements_.size()) { | 176 while (current_index < elements_.size()) { |
177 elements_[current_index]->Abort(delegate); | 177 elements_[current_index]->Abort(delegate); |
178 ++current_index; | 178 ++current_index; |
179 } | 179 } |
180 last_element_ = 0; | 180 last_element_ = 0; |
181 waiting_for_group_start_ = false; | 181 waiting_for_group_start_ = false; |
182 NotifyAborted(); | 182 NotifyAborted(); |
183 } | 183 } |
184 | 184 |
185 void LayerAnimationSequence::AddElement(LayerAnimationElement* element) { | 185 void LayerAnimationSequence::AddElement(LayerAnimationElement* element) { |
loyso (OOO)
2016/12/06 04:21:56
AddElement(std::unique_ptr<LayerAnimationElement>
| |
186 properties_ |= element->properties(); | 186 properties_ |= element->properties(); |
187 elements_.push_back(make_linked_ptr(element)); | 187 elements_.emplace_back(element); |
loyso (OOO)
2016/12/06 04:21:56
push_back(std::move(element))
| |
188 } | 188 } |
189 | 189 |
190 bool LayerAnimationSequence::HasConflictingProperty( | 190 bool LayerAnimationSequence::HasConflictingProperty( |
191 LayerAnimationElement::AnimatableProperties other) const { | 191 LayerAnimationElement::AnimatableProperties other) const { |
192 return (properties_ & other) != LayerAnimationElement::UNKNOWN; | 192 return (properties_ & other) != LayerAnimationElement::UNKNOWN; |
193 } | 193 } |
194 | 194 |
195 bool LayerAnimationSequence::IsFirstElementThreaded() const { | 195 bool LayerAnimationSequence::IsFirstElementThreaded() const { |
196 if (!elements_.empty()) | 196 if (!elements_.empty()) |
197 return elements_[0]->IsThreaded(); | 197 return elements_[0]->IsThreaded(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 | 275 |
276 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { | 276 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { |
277 if (elements_.empty()) | 277 if (elements_.empty()) |
278 return NULL; | 278 return NULL; |
279 | 279 |
280 size_t current_index = last_element_ % elements_.size(); | 280 size_t current_index = last_element_ % elements_.size(); |
281 return elements_[current_index].get(); | 281 return elements_[current_index].get(); |
282 } | 282 } |
283 | 283 |
284 } // namespace ui | 284 } // namespace ui |
OLD | NEW |