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

Side by Side Diff: Source/core/animation/DocumentTimeline.cpp

Issue 28263002: Plumb timeToNextEffect through players and animation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months 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 unified diff | Download patch
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations"); 67 TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations");
68 // FIXME: The below ASSERT fires on Windows when running chrome.exe. 68 // FIXME: The below ASSERT fires on Windows when running chrome.exe.
69 // Does not fire with --single-process, or on Linux, or in 69 // Does not fire with --single-process, or on Linux, or in
70 // content_shell.exe. The assert condition has been moved up into the 70 // content_shell.exe. The assert condition has been moved up into the
71 // outer 'if' to work around this. http://crbug.com/280439. 71 // outer 'if' to work around this. http://crbug.com/280439.
72 if (!isNull(m_zeroTimeAsPerfTime) && (m_currentTime <= monotonicAnimatio nStartTime - m_zeroTimeAsPerfTime)) { 72 if (!isNull(m_zeroTimeAsPerfTime) && (m_currentTime <= monotonicAnimatio nStartTime - m_zeroTimeAsPerfTime)) {
73 ASSERT(m_currentTime <= monotonicAnimationStartTime - m_zeroTimeAsPe rfTime); 73 ASSERT(m_currentTime <= monotonicAnimationStartTime - m_zeroTimeAsPe rfTime);
74 m_currentTime = monotonicAnimationStartTime - m_zeroTimeAsPerfTime; 74 m_currentTime = monotonicAnimationStartTime - m_zeroTimeAsPerfTime;
75 } 75 }
76 76
77 double timeToNextEffect = -1;
77 for (int i = m_players.size() - 1; i >= 0; --i) { 78 for (int i = m_players.size() - 1; i >= 0; --i) {
78 if (!m_players[i]->update()) 79 if (!m_players[i]->update(timeToNextEffect))
Timothy Loh 2013/10/18 06:01:27 Won't this only keep the last value?
shans 2013/10/21 00:37:57 Yeah. This point is where the next patch would kic
79 m_players.remove(i); 80 m_players.remove(i);
80 } 81 }
81 82
82 if (m_document->view() && !m_players.isEmpty()) 83 if (m_document->view() && !m_players.isEmpty())
83 m_document->view()->scheduleAnimation(); 84 m_document->view()->scheduleAnimation();
84 } 85 }
85 86
86 dispatchEvents(); 87 dispatchEvents();
87 } 88 }
88 89
(...skipping 22 matching lines...) Expand all
111 } 112 }
112 113
113 size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const 114 size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const
114 { 115 {
115 // Includes all players whose directly associated timed items 116 // Includes all players whose directly associated timed items
116 // are current or in effect. 117 // are current or in effect.
117 return isNull(m_currentTime) ? 0 : m_players.size(); 118 return isNull(m_currentTime) ? 0 : m_players.size();
118 } 119 }
119 120
120 } // namespace 121 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698