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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 { | 72 { |
73 RefPtr<AnimationPlayer> player = AnimationPlayer::create(*this, child); | 73 RefPtr<AnimationPlayer> player = AnimationPlayer::create(*this, child); |
74 AnimationPlayer* result = player.get(); | 74 AnimationPlayer* result = player.get(); |
75 m_players.add(result); | 75 m_players.add(result); |
76 setOutdatedAnimationPlayer(result); | 76 setOutdatedAnimationPlayer(result); |
77 return result; | 77 return result; |
78 } | 78 } |
79 | 79 |
80 AnimationPlayer* DocumentTimeline::play(TimedItem* child) | 80 AnimationPlayer* DocumentTimeline::play(TimedItem* child) |
81 { | 81 { |
| 82 if (!m_document) |
| 83 return 0; |
82 AnimationPlayer* player = createAnimationPlayer(child); | 84 AnimationPlayer* player = createAnimationPlayer(child); |
83 player->setStartTime(effectiveTime()); | 85 player->setStartTime(effectiveTime()); |
84 return player; | 86 return player; |
85 } | 87 } |
86 | 88 |
87 void DocumentTimeline::wake() | 89 void DocumentTimeline::wake() |
88 { | 90 { |
89 m_timing->serviceOnNextFrame(); | 91 m_timing->serviceOnNextFrame(); |
90 } | 92 } |
91 | 93 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 size_t count = 0; | 185 size_t count = 0; |
184 for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate
.begin(); it != m_playersNeedingUpdate.end(); ++it) { | 186 for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate
.begin(); it != m_playersNeedingUpdate.end(); ++it) { |
185 const TimedItem* timedItem = (*it)->source(); | 187 const TimedItem* timedItem = (*it)->source(); |
186 if ((*it)->hasStartTime()) | 188 if ((*it)->hasStartTime()) |
187 count += (timedItem && (timedItem->isCurrent() || timedItem->isInEff
ect())); | 189 count += (timedItem && (timedItem->isCurrent() || timedItem->isInEff
ect())); |
188 } | 190 } |
189 return count; | 191 return count; |
190 } | 192 } |
191 | 193 |
192 void DocumentTimeline::detachFromDocument() { | 194 void DocumentTimeline::detachFromDocument() { |
| 195 // FIXME: DocumentTimeline should keep Document alive. |
193 m_document = 0; | 196 m_document = 0; |
194 } | 197 } |
195 | 198 |
196 } // namespace | 199 } // namespace |
OLD | NEW |