OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 30 matching lines...) Expand all Loading... |
41 namespace { | 41 namespace { |
42 | 42 |
43 static unsigned nextSequenceNumber() | 43 static unsigned nextSequenceNumber() |
44 { | 44 { |
45 static unsigned next = 0; | 45 static unsigned next = 0; |
46 return ++next; | 46 return ++next; |
47 } | 47 } |
48 | 48 |
49 } | 49 } |
50 | 50 |
51 PassRefPtrWillBeRawPtr<AnimationPlayer> AnimationPlayer::create(AnimationTimelin
e& timeline, TimedItem* content) | 51 PassRefPtrWillBeRawPtr<AnimationPlayer> AnimationPlayer::create(AnimationTimelin
e& timeline, AnimationSource* content) |
52 { | 52 { |
53 return adoptRefWillBeRefCountedGarbageCollected(new AnimationPlayer(timeline
, content)); | 53 return adoptRefWillBeRefCountedGarbageCollected(new AnimationPlayer(timeline
, content)); |
54 } | 54 } |
55 | 55 |
56 AnimationPlayer::AnimationPlayer(AnimationTimeline& timeline, TimedItem* content
) | 56 AnimationPlayer::AnimationPlayer(AnimationTimeline& timeline, AnimationSource* c
ontent) |
57 : m_playbackRate(1) | 57 : m_playbackRate(1) |
58 , m_startTime(nullValue()) | 58 , m_startTime(nullValue()) |
59 , m_holdTime(nullValue()) | 59 , m_holdTime(nullValue()) |
60 , m_storedTimeLag(0) | 60 , m_storedTimeLag(0) |
61 , m_sortInfo(nextSequenceNumber(), timeline.effectiveTime()) | 61 , m_sortInfo(nextSequenceNumber(), timeline.effectiveTime()) |
62 , m_content(content) | 62 , m_content(content) |
63 , m_timeline(&timeline) | 63 , m_timeline(&timeline) |
64 , m_paused(false) | 64 , m_paused(false) |
65 , m_held(false) | 65 , m_held(false) |
66 , m_isPausedForTesting(false) | 66 , m_isPausedForTesting(false) |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // Even though this player is not outdated, time to effect change is | 186 // Even though this player is not outdated, time to effect change is |
187 // infinity until start time is set. | 187 // infinity until start time is set. |
188 m_timeline->wake(); | 188 m_timeline->wake(); |
189 } | 189 } |
190 if (!isUpdateFromCompositor) { | 190 if (!isUpdateFromCompositor) { |
191 cancelAnimationOnCompositor(); | 191 cancelAnimationOnCompositor(); |
192 schedulePendingAnimationOnCompositor(); | 192 schedulePendingAnimationOnCompositor(); |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 void AnimationPlayer::setSource(TimedItem* newSource) | 196 void AnimationPlayer::setSource(AnimationSource* newSource) |
197 { | 197 { |
198 if (m_content == newSource) | 198 if (m_content == newSource) |
199 return; | 199 return; |
200 cancelAnimationOnCompositor(); | 200 cancelAnimationOnCompositor(); |
201 double storedCurrentTime = currentTimeInternal(); | 201 double storedCurrentTime = currentTimeInternal(); |
202 if (m_content) | 202 if (m_content) |
203 m_content->detach(); | 203 m_content->detach(); |
204 m_content = newSource; | 204 m_content = newSource; |
205 if (newSource) { | 205 if (newSource) { |
206 // FIXME: This logic needs to be updated once groups are implemented | 206 // FIXME: This logic needs to be updated once groups are implemented |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 pause(); | 431 pause(); |
432 } | 432 } |
433 | 433 |
434 void AnimationPlayer::trace(Visitor* visitor) | 434 void AnimationPlayer::trace(Visitor* visitor) |
435 { | 435 { |
436 visitor->trace(m_content); | 436 visitor->trace(m_content); |
437 visitor->trace(m_timeline); | 437 visitor->trace(m_timeline); |
438 } | 438 } |
439 | 439 |
440 } // namespace | 440 } // namespace |
OLD | NEW |