Chromium Code Reviews| 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 (Animation* animation : m_animations) | |
| 47 animation->notifyElementDestroyed(); | |
|
haraken
2015/05/08 00:13:06
Ditto.
peria
2015/05/08 02:21:20
Acknowledged.
| |
| 48 m_animations.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_players) { | 49 for (const auto& entry : m_players) { |
| 55 const AnimationPlayer& player = *entry.key; | 50 const AnimationPlayer& player = *entry.key; |
| 56 ASSERT(player.source()); | 51 ASSERT(player.source()); |
| 57 // FIXME: Needs to consider AnimationGroup once added. | 52 // FIXME: Needs to consider AnimationGroup once added. |
| 58 ASSERT(player.source()->isAnimation()); | 53 ASSERT(player.source()->isAnimation()); |
| 59 const Animation& animation = *toAnimation(player.source()); | 54 const Animation& animation = *toAnimation(player.source()); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 76 } | 71 } |
| 77 | 72 |
| 78 void ElementAnimations::restartAnimationOnCompositor() | 73 void ElementAnimations::restartAnimationOnCompositor() |
| 79 { | 74 { |
| 80 for (const auto& entry : m_players) | 75 for (const auto& entry : m_players) |
| 81 entry.key->restartAnimationOnCompositor(); | 76 entry.key->restartAnimationOnCompositor(); |
| 82 } | 77 } |
| 83 | 78 |
| 84 DEFINE_TRACE(ElementAnimations) | 79 DEFINE_TRACE(ElementAnimations) |
| 85 { | 80 { |
| 86 #if ENABLE(OILPAN) | |
| 87 visitor->trace(m_cssAnimations); | 81 visitor->trace(m_cssAnimations); |
| 88 visitor->trace(m_defaultStack); | 82 visitor->trace(m_defaultStack); |
| 83 #if ENABLE(OILPAN) | |
| 89 visitor->trace(m_players); | 84 visitor->trace(m_players); |
| 90 #endif | 85 #endif |
| 91 } | 86 } |
| 92 | 87 |
| 93 const ComputedStyle* ElementAnimations::baseComputedStyle() const | 88 const ComputedStyle* ElementAnimations::baseComputedStyle() const |
| 94 { | 89 { |
| 95 #if !ENABLE(ASSERT) | |
| 96 if (isAnimationStyleChange()) | |
| 97 return m_baseComputedStyle.get(); | |
| 98 #endif | |
| 99 return nullptr; | 90 return nullptr; |
| 100 } | 91 } |
| 101 | 92 |
| 102 void ElementAnimations::updateBaseComputedStyle(const ComputedStyle* computedSty le) | 93 void ElementAnimations::updateBaseComputedStyle(const ComputedStyle* computedSty le) |
| 103 { | 94 { |
| 104 if (!isAnimationStyleChange()) { | 95 if (!isAnimationStyleChange()) { |
| 105 m_baseComputedStyle = nullptr; | 96 m_baseComputedStyle = nullptr; |
| 106 return; | 97 return; |
| 107 } | 98 } |
| 108 #if ENABLE(ASSERT) | 99 #if ENABLE(ASSERT) |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 122 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing | 113 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing |
| 123 // a style recalc (see crbug.com/471079). ComputedStyle objects created with different cache | 114 // a style recalc (see crbug.com/471079). ComputedStyle objects created with different cache |
| 124 // versions will not be considered equal as Font::operator== will compare ve rsions, hence | 115 // versions will not be considered equal as Font::operator== will compare ve rsions, hence |
| 125 // ComputedStyle::operator== will return false. We avoid using baseComputedS tyle (the check for | 116 // ComputedStyle::operator== will return false. We avoid using baseComputedS tyle (the check for |
| 126 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com parison ASSERT | 117 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com parison ASSERT |
| 127 // in updateBaseComputedStyle. | 118 // in updateBaseComputedStyle. |
| 128 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid()); | 119 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid()); |
| 129 } | 120 } |
| 130 | 121 |
| 131 } // namespace blink | 122 } // namespace blink |
| OLD | NEW |