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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 ActiveAnimations::~ActiveAnimations() | 38 ActiveAnimations::~ActiveAnimations() |
39 { | 39 { |
40 #if !ENABLE(OILPAN) | 40 #if !ENABLE(OILPAN) |
41 for (size_t i = 0; i < m_animations.size(); ++i) | 41 for (size_t i = 0; i < m_animations.size(); ++i) |
42 m_animations[i]->notifyElementDestroyed(); | 42 m_animations[i]->notifyElementDestroyed(); |
43 m_animations.clear(); | 43 m_animations.clear(); |
44 #endif | 44 #endif |
45 } | 45 } |
46 | 46 |
47 void ActiveAnimations::addPlayer(AnimationPlayer* player) | |
48 { | |
49 ++m_players.add(player, 0).storedValue->value; | |
50 } | |
51 | |
52 void ActiveAnimations::removePlayer(AnimationPlayer* player) | |
53 { | |
54 AnimationPlayerCountedSet::iterator it = m_players.find(player); | |
55 ASSERT(it != m_players.end()); | |
56 ASSERT(it->value > 0); | |
57 --it->value; | |
58 if (!it->value) | |
59 m_players.remove(it); | |
60 } | |
61 | |
62 void ActiveAnimations::updateAnimationFlags(RenderStyle& style) | 47 void ActiveAnimations::updateAnimationFlags(RenderStyle& style) |
63 { | 48 { |
64 for (AnimationPlayerCountedSet::const_iterator it = m_players.begin(); it !=
m_players.end(); ++it) { | 49 for (AnimationPlayerCountedSet::const_iterator it = m_players.begin(); it !=
m_players.end(); ++it) { |
65 const AnimationPlayer& player = *it->key; | 50 const AnimationPlayer& player = *it->key; |
66 ASSERT(player.source()); | 51 ASSERT(player.source()); |
67 // FIXME: Needs to consider AnimationGroup once added. | 52 // FIXME: Needs to consider AnimationGroup once added. |
68 ASSERT(player.source()->isAnimation()); | 53 ASSERT(player.source()->isAnimation()); |
69 const Animation& animation = *toAnimation(player.source()); | 54 const Animation& animation = *toAnimation(player.source()); |
70 if (animation.isCurrent()) { | 55 if (animation.isCurrent()) { |
71 if (animation.affects(CSSPropertyOpacity)) | 56 if (animation.affects(CSSPropertyOpacity)) |
(...skipping 22 matching lines...) Expand all Loading... |
94 void ActiveAnimations::trace(Visitor* visitor) | 79 void ActiveAnimations::trace(Visitor* visitor) |
95 { | 80 { |
96 #if ENABLE(OILPAN) | 81 #if ENABLE(OILPAN) |
97 visitor->trace(m_cssAnimations); | 82 visitor->trace(m_cssAnimations); |
98 visitor->trace(m_defaultStack); | 83 visitor->trace(m_defaultStack); |
99 visitor->trace(m_players); | 84 visitor->trace(m_players); |
100 #endif | 85 #endif |
101 } | 86 } |
102 | 87 |
103 } // namespace blink | 88 } // namespace blink |
OLD | NEW |