| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (isNull(m_startTime)) | 80 if (isNull(m_startTime)) |
| 81 return 0; | 81 return 0; |
| 82 return (effectiveTime(m_timeline.currentTime()) - startTime()) * m_playbackR
ate; | 82 return (effectiveTime(m_timeline.currentTime()) - startTime()) * m_playbackR
ate; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool Player::maybeStartAnimationOnCompositor() | 85 bool Player::maybeStartAnimationOnCompositor() |
| 86 { | 86 { |
| 87 // FIXME: Support starting compositor animations that have a fixed | 87 // FIXME: Support starting compositor animations that have a fixed |
| 88 // start time. | 88 // start time. |
| 89 ASSERT(!hasStartTime()); | 89 ASSERT(!hasStartTime()); |
| 90 if (!m_content || !m_content->isAnimation()) | 90 if (!m_content || !m_content->isAnimation() || paused()) |
| 91 return false; | 91 return false; |
| 92 | 92 |
| 93 return toAnimation(m_content.get())->maybeStartAnimationOnCompositor(); | 93 return toAnimation(m_content.get())->maybeStartAnimationOnCompositor(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool Player::hasActiveAnimationsOnCompositor() | 96 bool Player::hasActiveAnimationsOnCompositor() |
| 97 { | 97 { |
| 98 if (!m_content || !m_content->isAnimation()) | 98 if (!m_content || !m_content->isAnimation()) |
| 99 return false; | 99 return false; |
| 100 return toAnimation(m_content.get())->hasActiveAnimationsOnCompositor(); | 100 return toAnimation(m_content.get())->hasActiveAnimationsOnCompositor(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 void Player::setPlaybackRate(double newRate) | 197 void Player::setPlaybackRate(double newRate) |
| 198 { | 198 { |
| 199 double previousTime = currentTime(); | 199 double previousTime = currentTime(); |
| 200 m_playbackRate = newRate; | 200 m_playbackRate = newRate; |
| 201 setCurrentTime(previousTime); | 201 setCurrentTime(previousTime); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace | 204 } // namespace |
| OLD | NEW |