| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 void PendingAnimations::add(AnimationPlayer* player) | 42 void PendingAnimations::add(AnimationPlayer* player) |
| 43 { | 43 { |
| 44 ASSERT(player); | 44 ASSERT(player); |
| 45 ASSERT(m_pending.find(player) == kNotFound); | 45 ASSERT(m_pending.find(player) == kNotFound); |
| 46 m_pending.append(player); | 46 m_pending.append(player); |
| 47 | 47 |
| 48 Document* document = player->timeline()->document(); | 48 Document* document = player->timeline()->document(); |
| 49 if (document->view()) | 49 document->scheduleVisualUpdate(); |
| 50 document->view()->scheduleAnimation(); | |
| 51 | 50 |
| 52 bool visible = document->page() && document->page()->visibilityState() == Pa
geVisibilityStateVisible; | 51 bool visible = document->page() && document->page()->visibilityState() == Pa
geVisibilityStateVisible; |
| 53 if (!visible && !m_timer.isActive()) { | 52 if (!visible && !m_timer.isActive()) { |
| 54 m_timer.startOneShot(0, FROM_HERE); | 53 m_timer.startOneShot(0, FROM_HERE); |
| 55 } | 54 } |
| 56 } | 55 } |
| 57 | 56 |
| 58 bool PendingAnimations::update() | 57 bool PendingAnimations::update() |
| 59 { | 58 { |
| 60 Vector<AnimationPlayer*> waitingForStartTime; | 59 Vector<AnimationPlayer*> waitingForStartTime; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 79 for (size_t i = 0; i < players.size(); ++i) { | 78 for (size_t i = 0; i < players.size(); ++i) { |
| 80 AnimationPlayer& player = *players[i].get(); | 79 AnimationPlayer& player = *players[i].get(); |
| 81 player.postCommit(player.timeline()->currentTimeInternal()); | 80 player.postCommit(player.timeline()->currentTimeInternal()); |
| 82 } | 81 } |
| 83 | 82 |
| 84 ASSERT(m_pending.isEmpty()); | 83 ASSERT(m_pending.isEmpty()); |
| 85 return false; | 84 return false; |
| 86 } | 85 } |
| 87 | 86 |
| 88 } // namespace | 87 } // namespace |
| OLD | NEW |