| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/animation/ActiveAnimations.h" | 32 #include "core/animation/ActiveAnimations.h" |
| 33 | 33 |
| 34 #include "core/rendering/RenderObject.h" | 34 #include "core/rendering/RenderObject.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 void ActiveAnimations::updateAnimationFlags(RenderStyle& style) | 38 void ActiveAnimations::updateAnimationFlags(RenderStyle& style) |
| 39 { | 39 { |
| 40 for (AnimationPlayerSet::const_iterator it = m_players.begin(); it != player
s().end(); ++it) { | 40 for (AnimationPlayerSet::const_iterator it = m_players.begin(); it != player
s().end(); ++it) { |
| 41 const AnimationPlayer& player = *it->key; | 41 AnimationPlayer* player = *it; |
| 42 ASSERT(player.source()); | 42 ASSERT(player->source()); |
| 43 // FIXME: Needs to consider AnimationGroup once added. | 43 // FIXME: Needs to consider AnimationGroup once added. |
| 44 ASSERT(player.source()->isAnimation()); | 44 ASSERT(player->source()->isAnimation()); |
| 45 const Animation& animation = *toAnimation(player.source()); | 45 const Animation& animation = *toAnimation(player->source()); |
| 46 if (animation.isCurrent()) { | 46 if (animation.isCurrent()) { |
| 47 if (animation.affects(CSSPropertyOpacity)) | 47 if (animation.affects(CSSPropertyOpacity)) |
| 48 style.setHasCurrentOpacityAnimation(true); | 48 style.setHasCurrentOpacityAnimation(true); |
| 49 if (animation.affects(CSSPropertyTransform)) | 49 if (animation.affects(CSSPropertyTransform)) |
| 50 style.setHasCurrentTransformAnimation(true); | 50 style.setHasCurrentTransformAnimation(true); |
| 51 if (animation.affects(CSSPropertyWebkitFilter)) | 51 if (animation.affects(CSSPropertyWebkitFilter)) |
| 52 style.setHasCurrentFilterAnimation(true); | 52 style.setHasCurrentFilterAnimation(true); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 if (style.hasCurrentOpacityAnimation()) | 56 if (style.hasCurrentOpacityAnimation()) |
| 57 style.setIsRunningOpacityAnimationOnCompositor(m_defaultStack.hasActiveA
nimationsOnCompositor(CSSPropertyOpacity)); | 57 style.setIsRunningOpacityAnimationOnCompositor(m_defaultStack.hasActiveA
nimationsOnCompositor(CSSPropertyOpacity)); |
| 58 if (style.hasCurrentTransformAnimation()) | 58 if (style.hasCurrentTransformAnimation()) |
| 59 style.setIsRunningTransformAnimationOnCompositor(m_defaultStack.hasActiv
eAnimationsOnCompositor(CSSPropertyTransform)); | 59 style.setIsRunningTransformAnimationOnCompositor(m_defaultStack.hasActiv
eAnimationsOnCompositor(CSSPropertyTransform)); |
| 60 if (style.hasCurrentFilterAnimation()) | 60 if (style.hasCurrentFilterAnimation()) |
| 61 style.setIsRunningFilterAnimationOnCompositor(m_defaultStack.hasActiveAn
imationsOnCompositor(CSSPropertyWebkitFilter)); | 61 style.setIsRunningFilterAnimationOnCompositor(m_defaultStack.hasActiveAn
imationsOnCompositor(CSSPropertyWebkitFilter)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ActiveAnimations::cancelAnimationOnCompositor() | 64 void ActiveAnimations::cancelAnimationOnCompositor() |
| 65 { | 65 { |
| 66 for (AnimationPlayerSet::iterator it = m_players.begin(); it != players().en
d(); ++it) | 66 for (AnimationPlayerSet::iterator it = m_players.begin(); it != players().en
d(); ++it) |
| 67 it->key->cancelAnimationOnCompositor(); | 67 (*it)->cancelAnimationOnCompositor(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ActiveAnimations::trace(Visitor* visitor) | 70 void ActiveAnimations::trace(Visitor* visitor) |
| 71 { | 71 { |
| 72 visitor->trace(m_cssAnimations); | 72 visitor->trace(m_cssAnimations); |
| 73 visitor->trace(m_defaultStack); |
| 74 visitor->trace(m_players); |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace WebCore | 77 } // namespace WebCore |
| OLD | NEW |