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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 , m_target(target) | 322 , m_target(target) |
323 , m_effect(effect) | 323 , m_effect(effect) |
324 , m_activeInAnimationStack(false) | 324 , m_activeInAnimationStack(false) |
325 , m_priority(priority) | 325 , m_priority(priority) |
326 { | 326 { |
327 } | 327 } |
328 | 328 |
329 void Animation::didAttach() | 329 void Animation::didAttach() |
330 { | 330 { |
331 if (m_target) | 331 if (m_target) |
332 m_target->ensureActiveAnimations()->players().add(player()); | 332 m_target->ensureActiveAnimations().players().add(player()); |
333 } | 333 } |
334 | 334 |
335 void Animation::willDetach() | 335 void Animation::willDetach() |
336 { | 336 { |
337 if (m_target) | 337 if (m_target) |
338 m_target->activeAnimations()->players().remove(player()); | 338 m_target->activeAnimations()->players().remove(player()); |
339 if (m_activeInAnimationStack) | 339 if (m_activeInAnimationStack) |
340 clearEffects(); | 340 clearEffects(); |
341 } | 341 } |
342 | 342 |
343 static AnimationStack& ensureAnimationStack(Element* element) | 343 static AnimationStack& ensureAnimationStack(Element* element) |
344 { | 344 { |
345 return element->ensureActiveAnimations()->defaultStack(); | 345 return element->ensureActiveAnimations().defaultStack(); |
346 } | 346 } |
347 | 347 |
348 void Animation::applyEffects(bool previouslyInEffect) | 348 void Animation::applyEffects(bool previouslyInEffect) |
349 { | 349 { |
350 ASSERT(isInEffect()); | 350 ASSERT(isInEffect()); |
351 if (!m_target || !m_effect) | 351 if (!m_target || !m_effect) |
352 return; | 352 return; |
353 | 353 |
354 if (player() && !previouslyInEffect) { | 354 if (player() && !previouslyInEffect) { |
355 ensureAnimationStack(m_target.get()).add(this); | 355 ensureAnimationStack(m_target.get()).add(this); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) | 478 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) |
479 { | 479 { |
480 ASSERT(hasActiveAnimationsOnCompositor()); | 480 ASSERT(hasActiveAnimationsOnCompositor()); |
481 if (!m_target || !m_target->renderer()) | 481 if (!m_target || !m_target->renderer()) |
482 return; | 482 return; |
483 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) | 483 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) |
484 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target.get(), m_compositorAnimationIds[i], pauseTime); | 484 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target.get(), m_compositorAnimationIds[i], pauseTime); |
485 } | 485 } |
486 | 486 |
487 } // namespace WebCore | 487 } // namespace WebCore |
OLD | NEW |