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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 ElementAnimations::ElementAnimations() | 38 ElementAnimations::ElementAnimations() |
39 : m_animationStyleChange(false) | 39 : m_animationStyleChange(false) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 ElementAnimations::~ElementAnimations() | 43 ElementAnimations::~ElementAnimations() |
44 { | 44 { |
45 #if !ENABLE(OILPAN) | |
46 for (KeyframeEffect* effect : m_effects) | |
47 effect->notifyElementDestroyed(); | |
48 m_effects.clear(); | |
49 #endif | |
50 } | 45 } |
51 | 46 |
52 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) | 47 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) |
53 { | 48 { |
54 for (const auto& entry : m_animations) { | 49 for (const auto& entry : m_animations) { |
55 const Animation& animation = *entry.key; | 50 const Animation& animation = *entry.key; |
56 ASSERT(animation.effect()); | 51 ASSERT(animation.effect()); |
57 // FIXME: Needs to consider AnimationGroup once added. | 52 // FIXME: Needs to consider AnimationGroup once added. |
58 ASSERT(animation.effect()->isAnimation()); | 53 ASSERT(animation.effect()->isAnimation()); |
59 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); | 54 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); |
(...skipping 19 matching lines...) Expand all Loading... |
79 } | 74 } |
80 | 75 |
81 void ElementAnimations::restartAnimationOnCompositor() | 76 void ElementAnimations::restartAnimationOnCompositor() |
82 { | 77 { |
83 for (const auto& entry : m_animations) | 78 for (const auto& entry : m_animations) |
84 entry.key->restartAnimationOnCompositor(); | 79 entry.key->restartAnimationOnCompositor(); |
85 } | 80 } |
86 | 81 |
87 DEFINE_TRACE(ElementAnimations) | 82 DEFINE_TRACE(ElementAnimations) |
88 { | 83 { |
89 #if ENABLE(OILPAN) | |
90 visitor->trace(m_cssAnimations); | 84 visitor->trace(m_cssAnimations); |
91 visitor->trace(m_defaultStack); | 85 visitor->trace(m_defaultStack); |
92 visitor->trace(m_animations); | 86 visitor->trace(m_animations); |
93 #endif | |
94 } | 87 } |
95 | 88 |
96 const ComputedStyle* ElementAnimations::baseComputedStyle() const | 89 const ComputedStyle* ElementAnimations::baseComputedStyle() const |
97 { | 90 { |
98 #if !ENABLE(ASSERT) | 91 #if !ENABLE(ASSERT) |
99 if (isAnimationStyleChange()) | 92 if (isAnimationStyleChange()) |
100 return m_baseComputedStyle.get(); | 93 return m_baseComputedStyle.get(); |
101 #endif | 94 #endif |
102 return nullptr; | 95 return nullptr; |
103 } | 96 } |
(...skipping 21 matching lines...) Expand all Loading... |
125 // TODO(rune@opera.com): The FontFaceCache version number may be increased w
ithout forcing | 118 // TODO(rune@opera.com): The FontFaceCache version number may be increased w
ithout forcing |
126 // a style recalc (see crbug.com/471079). ComputedStyle objects created with
different cache | 119 // a style recalc (see crbug.com/471079). ComputedStyle objects created with
different cache |
127 // versions will not be considered equal as Font::operator== will compare ve
rsions, hence | 120 // versions will not be considered equal as Font::operator== will compare ve
rsions, hence |
128 // ComputedStyle::operator== will return false. We avoid using baseComputedS
tyle (the check for | 121 // ComputedStyle::operator== will return false. We avoid using baseComputedS
tyle (the check for |
129 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com
parison ASSERT | 122 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com
parison ASSERT |
130 // in updateBaseComputedStyle. | 123 // in updateBaseComputedStyle. |
131 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl
e->font().isFallbackValid()); | 124 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl
e->font().isFallbackValid()); |
132 } | 125 } |
133 | 126 |
134 } // namespace blink | 127 } // namespace blink |
OLD | NEW |