| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 : calculateCurrentTime(); | 254 : calculateCurrentTime(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 bool Animation::preCommit(int compositorGroup, bool startOnCompositor) { | 257 bool Animation::preCommit(int compositorGroup, bool startOnCompositor) { |
| 258 PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand, | 258 PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand, |
| 259 DoNotSetCompositorPending); | 259 DoNotSetCompositorPending); |
| 260 | 260 |
| 261 bool softChange = | 261 bool softChange = |
| 262 m_compositorState && | 262 m_compositorState && |
| 263 (paused() || m_compositorState->playbackRate != m_playbackRate); | 263 (paused() || m_compositorState->playbackRate != m_playbackRate); |
| 264 bool hardChange = | 264 bool hardChange = m_compositorState && |
| 265 m_compositorState && (m_compositorState->effectChanged || | 265 (m_compositorState->effectChanged || |
| 266 m_compositorState->startTime != m_startTime); | 266 m_compositorState->startTime != m_startTime); |
| 267 | 267 |
| 268 // FIXME: softChange && !hardChange should generate a Pause/ThenStart, | 268 // FIXME: softChange && !hardChange should generate a Pause/ThenStart, |
| 269 // not a Cancel, but we can't communicate these to the compositor yet. | 269 // not a Cancel, but we can't communicate these to the compositor yet. |
| 270 | 270 |
| 271 bool changed = softChange || hardChange; | 271 bool changed = softChange || hardChange; |
| 272 bool shouldCancel = (!playing() && m_compositorState) || changed; | 272 bool shouldCancel = (!playing() && m_compositorState) || changed; |
| 273 bool shouldStart = playing() && (!m_compositorState || changed); | 273 bool shouldStart = playing() && (!m_compositorState || changed); |
| 274 | 274 |
| 275 if (startOnCompositor && shouldCancel && shouldStart && m_compositorState && | 275 if (startOnCompositor && shouldCancel && shouldStart && m_compositorState && |
| 276 m_compositorState->pendingAction == Start) { | 276 m_compositorState->pendingAction == Start) { |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 DCHECK(!m_compositorPlayer); | 1150 DCHECK(!m_compositorPlayer); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 void Animation::CompositorAnimationPlayerHolder::detach() { | 1153 void Animation::CompositorAnimationPlayerHolder::detach() { |
| 1154 DCHECK(m_compositorPlayer); | 1154 DCHECK(m_compositorPlayer); |
| 1155 m_compositorPlayer->setAnimationDelegate(nullptr); | 1155 m_compositorPlayer->setAnimationDelegate(nullptr); |
| 1156 m_animation = nullptr; | 1156 m_animation = nullptr; |
| 1157 m_compositorPlayer.reset(); | 1157 m_compositorPlayer.reset(); |
| 1158 } | 1158 } |
| 1159 } // namespace blink | 1159 } // namespace blink |
| OLD | NEW |