| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 return hasActiveAnimationsOnCompositor() && affects(property); | 269 return hasActiveAnimationsOnCompositor() && affects(property); |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool Animation::affects(CSSPropertyID property) const | 272 bool Animation::affects(CSSPropertyID property) const |
| 273 { | 273 { |
| 274 return m_effect && m_effect->affects(property); | 274 return m_effect && m_effect->affects(property); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void Animation::cancelAnimationOnCompositor() | 277 void Animation::cancelAnimationOnCompositor() |
| 278 { | 278 { |
| 279 // FIXME: cancelAnimationOnCompositor is called from withins style recalc. | |
| 280 // This queries compositingState, which is not necessarily up to date. | |
| 281 // https://code.google.com/p/chromium/issues/detail?id=339847 | |
| 282 DisableCompositingQueryAsserts disabler; | |
| 283 if (!hasActiveAnimationsOnCompositor()) | 279 if (!hasActiveAnimationsOnCompositor()) |
| 284 return; | 280 return; |
| 285 if (!m_target || !m_target->renderer()) | 281 if (!m_target || !m_target->renderer()) |
| 286 return; | 282 return; |
| 287 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) | 283 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) |
| 288 CompositorAnimations::instance()->cancelAnimationOnCompositor(*m_target,
m_compositorAnimationIds[i]); | 284 CompositorAnimations::instance()->cancelAnimationOnCompositor(*m_target,
m_compositorAnimationIds[i]); |
| 289 m_compositorAnimationIds.clear(); | 285 m_compositorAnimationIds.clear(); |
| 290 player()->setCompositorPending(true); | 286 player()->setCompositorPending(true); |
| 291 } | 287 } |
| 292 | 288 |
| 293 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) | 289 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) |
| 294 { | 290 { |
| 295 ASSERT(hasActiveAnimationsOnCompositor()); | 291 ASSERT(hasActiveAnimationsOnCompositor()); |
| 296 if (!m_target || !m_target->renderer()) | 292 if (!m_target || !m_target->renderer()) |
| 297 return; | 293 return; |
| 298 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) | 294 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) |
| 299 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, m_compositorAnimationIds[i], pauseTime); | 295 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, m_compositorAnimationIds[i], pauseTime); |
| 300 } | 296 } |
| 301 | 297 |
| 302 } // namespace blink | 298 } // namespace blink |
| OLD | NEW |