OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/scheduled_animation_group.h" | 5 #include "services/ui/ws/scheduled_animation_group.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "services/ui/ws/server_window.h" | 9 #include "services/ui/ws/server_window.h" |
10 | 10 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 std::unique_ptr<ScheduledAnimationValue> value; | 197 std::unique_ptr<ScheduledAnimationValue> value; |
198 for (const ScheduledAnimationSequence& sequence : sequences) { | 198 for (const ScheduledAnimationSequence& sequence : sequences) { |
199 base::TimeDelta duration; | 199 base::TimeDelta duration; |
200 for (const ScheduledAnimationElement& element : sequence.elements) { | 200 for (const ScheduledAnimationElement& element : sequence.elements) { |
201 if (element.property != property) | 201 if (element.property != property) |
202 continue; | 202 continue; |
203 | 203 |
204 duration += element.duration; | 204 duration += element.duration; |
205 if (duration > max_end_duration) { | 205 if (duration > max_end_duration) { |
206 max_end_duration = duration; | 206 max_end_duration = duration; |
207 value.reset(new ScheduledAnimationValue(element.target_value)); | 207 value = base::MakeUnique<ScheduledAnimationValue>(element.target_value); |
208 } | 208 } |
209 } | 209 } |
210 } | 210 } |
211 if (value.get()) | 211 if (value.get()) |
212 SetWindowPropertyFromValue(window, property, *value); | 212 SetWindowPropertyFromValue(window, property, *value); |
213 } | 213 } |
214 | 214 |
215 void ConvertSequenceToScheduled( | 215 void ConvertSequenceToScheduled( |
216 const mojom::AnimationSequence& transport_sequence, | 216 const mojom::AnimationSequence& transport_sequence, |
217 base::TimeTicks now, | 217 base::TimeTicks now, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 return sequences_.empty(); | 348 return sequences_.empty(); |
349 } | 349 } |
350 | 350 |
351 ScheduledAnimationGroup::ScheduledAnimationGroup(ServerWindow* window, | 351 ScheduledAnimationGroup::ScheduledAnimationGroup(ServerWindow* window, |
352 uint32_t id, | 352 uint32_t id, |
353 base::TimeTicks time_scheduled) | 353 base::TimeTicks time_scheduled) |
354 : window_(window), id_(id), time_scheduled_(time_scheduled) {} | 354 : window_(window), id_(id), time_scheduled_(time_scheduled) {} |
355 | 355 |
356 } // namespace ws | 356 } // namespace ws |
357 } // namespace ui | 357 } // namespace ui |
OLD | NEW |