Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: Source/core/animation/DocumentTimeline.cpp

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup isRunning* and shouldCompositeForAnimation Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/DocumentTimeline.cpp
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index b3b7d08b93dcba629baae80b9b1073f6d829363f..29da7dd8ab6c7d9d504e4e006359b14756192d98 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -69,14 +69,20 @@ void DocumentTimeline::add(Player* player)
m_timing->serviceOnNextFrame();
}
-PassRefPtr<Player> DocumentTimeline::play(TimedItem* child)
+PassRefPtr<Player> DocumentTimeline::createPlayer(TimedItem* child)
Steve Block 2013/11/18 05:03:03 This should return a raw pointer, not a PRP. This
dstockwell 2013/11/18 06:11:20 Hmm, maybe I'm confused about how this works. I th
{
RefPtr<Player> player = Player::create(*this, child);
- player->setStartTime(currentTime());
add(player.get());
return player.release();
}
+PassRefPtr<Player> DocumentTimeline::play(TimedItem* child)
+{
+ RefPtr<Player> player = createPlayer(child);
+ player->setStartTime(currentTime());
+ return player.release();
+}
+
void DocumentTimeline::wake()
{
m_timing->serviceOnNextFrame();
@@ -156,9 +162,16 @@ void DocumentTimeline::dispatchEvents()
size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const
{
+ if (isNull(m_zeroTime))
+ return 0;
// Includes all players whose directly associated timed items
// are current or in effect.
- return isNull(m_zeroTime) ? 0 : m_players.size();
+ size_t started = 0;
+ for (size_t i = 0; i < m_players.size(); ++i) {
+ if (m_players[i]->hasStartTime())
+ ++started;
Steve Block 2013/11/18 05:03:03 I think this is wrong, but it was before too. See
dstockwell 2013/11/18 06:11:20 Will wait and rebase.
+ }
+ return started;
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698