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

Side by Side Diff: Source/core/animation/Player.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 double Player::timeDrift() const 77 double Player::timeDrift() const
78 { 78 {
79 return paused() ? pausedTimeDrift() : m_timeDrift; 79 return paused() ? pausedTimeDrift() : m_timeDrift;
80 } 80 }
81 81
82 double Player::currentTime() const 82 double Player::currentTime() const
83 { 83 {
84 return currentTimeBeforeDrift() - timeDrift(); 84 return currentTimeBeforeDrift() - timeDrift();
85 } 85 }
86 86
87 bool Player::update() 87 bool Player::update(double& timeToEffectChange)
88 { 88 {
89 if (!m_content) 89 if (!m_content)
90 return false; 90 return false;
91 91
92 double newTime = isNull(m_timeline->currentTime()) ? nullValue() : currentTi me(); 92 double newTime = isNull(m_timeline->currentTime()) ? nullValue() : currentTi me();
93 m_content->updateInheritedTime(newTime); 93 m_content->updateInheritedTime(newTime);
94 timeToEffectChange = m_content->timeToEffectChange();
94 return m_content->isCurrent() || m_content->isInEffect(); 95 return m_content->isCurrent() || m_content->isInEffect();
95 } 96 }
96 97
97 void Player::cancel() 98 void Player::cancel()
98 { 99 {
99 if (!m_content) 100 if (!m_content)
100 return; 101 return;
101 102
102 ASSERT(m_content->player() == this); 103 ASSERT(m_content->player() == this);
103 m_content->detach(); 104 m_content->detach();
(...skipping 24 matching lines...) Expand all
128 } 129 }
129 130
130 void Player::setPlaybackRate(double newRate) 131 void Player::setPlaybackRate(double newRate)
131 { 132 {
132 double previousTime = currentTime(); 133 double previousTime = currentTime();
133 m_playbackRate = newRate; 134 m_playbackRate = newRate;
134 setCurrentTime(previousTime); 135 setCurrentTime(previousTime);
135 } 136 }
136 137
137 } // namespace 138 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698