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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 bool Animation::cancelAnimationOnCompositor() | 267 bool Animation::cancelAnimationOnCompositor() |
268 { | 268 { |
269 // FIXME: cancelAnimationOnCompositor is called from withins style recalc. | 269 // FIXME: cancelAnimationOnCompositor is called from withins style recalc. |
270 // This queries compositingState, which is not necessarily up to date. | 270 // This queries compositingState, which is not necessarily up to date. |
271 // https://code.google.com/p/chromium/issues/detail?id=339847 | 271 // https://code.google.com/p/chromium/issues/detail?id=339847 |
272 DisableCompositingQueryAsserts disabler; | 272 DisableCompositingQueryAsserts disabler; |
273 if (!hasActiveAnimationsOnCompositor()) | 273 if (!hasActiveAnimationsOnCompositor()) |
274 return false; | 274 return false; |
275 if (!m_target || !m_target->renderer()) | 275 if (!m_target || !m_target->layoutObject()) |
276 return false; | 276 return false; |
277 for (const auto& compositorAnimationId : m_compositorAnimationIds) | 277 for (const auto& compositorAnimationId : m_compositorAnimationIds) |
278 CompositorAnimations::instance()->cancelAnimationOnCompositor(*m_target,
compositorAnimationId); | 278 CompositorAnimations::instance()->cancelAnimationOnCompositor(*m_target,
compositorAnimationId); |
279 m_compositorAnimationIds.clear(); | 279 m_compositorAnimationIds.clear(); |
280 return true; | 280 return true; |
281 } | 281 } |
282 | 282 |
283 void Animation::restartAnimationOnCompositor() | 283 void Animation::restartAnimationOnCompositor() |
284 { | 284 { |
285 if (cancelAnimationOnCompositor()) | 285 if (cancelAnimationOnCompositor()) |
286 player()->setCompositorPending(true); | 286 player()->setCompositorPending(true); |
287 } | 287 } |
288 | 288 |
289 void Animation::cancelIncompatibleAnimationsOnCompositor() | 289 void Animation::cancelIncompatibleAnimationsOnCompositor() |
290 { | 290 { |
291 if (m_target && player() && effect()) | 291 if (m_target && player() && effect()) |
292 CompositorAnimations::instance()->cancelIncompatibleAnimationsOnComposit
or(*m_target, *player(), *effect()); | 292 CompositorAnimations::instance()->cancelIncompatibleAnimationsOnComposit
or(*m_target, *player(), *effect()); |
293 } | 293 } |
294 | 294 |
295 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) | 295 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) |
296 { | 296 { |
297 ASSERT(hasActiveAnimationsOnCompositor()); | 297 ASSERT(hasActiveAnimationsOnCompositor()); |
298 if (!m_target || !m_target->renderer()) | 298 if (!m_target || !m_target->layoutObject()) |
299 return; | 299 return; |
300 for (const auto& compositorAnimationId : m_compositorAnimationIds) | 300 for (const auto& compositorAnimationId : m_compositorAnimationIds) |
301 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, compositorAnimationId, pauseTime); | 301 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, compositorAnimationId, pauseTime); |
302 } | 302 } |
303 | 303 |
304 DEFINE_TRACE(Animation) | 304 DEFINE_TRACE(Animation) |
305 { | 305 { |
306 visitor->trace(m_target); | 306 visitor->trace(m_target); |
307 visitor->trace(m_effect); | 307 visitor->trace(m_effect); |
308 visitor->trace(m_sampledEffect); | 308 visitor->trace(m_sampledEffect); |
309 AnimationNode::trace(visitor); | 309 AnimationNode::trace(visitor); |
310 } | 310 } |
311 | 311 |
312 } // namespace blink | 312 } // namespace blink |
OLD | NEW |