| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/SampledEffect.h" | 6 #include "core/animation/SampledEffect.h" |
| 7 | 7 |
| 8 #include "core/animation/SVGInterpolation.h" | 8 #include "core/animation/SVGInterpolation.h" |
| 9 #include "core/animation/StyleInterpolation.h" | 9 #include "core/animation/StyleInterpolation.h" |
| 10 #include "core/svg/SVGElement.h" | 10 #include "core/svg/SVGElement.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 SampledEffect::SampledEffect(KeyframeEffect* effect, PassOwnPtrWillBeRawPtr<Will
BeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations) | 14 SampledEffect::SampledEffect(KeyframeEffect* effect, HeapVector<Member<Interpola
tion>>* interpolations) |
| 15 : m_effect(effect) | 15 : m_effect(effect) |
| 16 , m_animation(effect->animation()) | 16 , m_animation(effect->animation()) |
| 17 , m_interpolations(interpolations) | 17 , m_interpolations(interpolations) |
| 18 , m_sequenceNumber(effect->animation()->sequenceNumber()) | 18 , m_sequenceNumber(effect->animation()->sequenceNumber()) |
| 19 , m_priority(effect->priority()) | 19 , m_priority(effect->priority()) |
| 20 { | 20 { |
| 21 ASSERT(m_interpolations && !m_interpolations->isEmpty()); | 21 ASSERT(m_interpolations && !m_interpolations->isEmpty()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void SampledEffect::clear() | 24 void SampledEffect::clear() |
| 25 { | 25 { |
| 26 m_effect = nullptr; | 26 m_effect = nullptr; |
| 27 m_animation = nullptr; | 27 m_animation = nullptr; |
| 28 m_interpolations->clear(); | 28 m_interpolations->clear(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 DEFINE_TRACE(SampledEffect) | 31 DEFINE_TRACE(SampledEffect) |
| 32 { | 32 { |
| 33 visitor->trace(m_effect); | 33 visitor->trace(m_effect); |
| 34 visitor->trace(m_animation); | 34 visitor->trace(m_animation); |
| 35 #if ENABLE(OILPAN) | |
| 36 visitor->trace(m_interpolations); | 35 visitor->trace(m_interpolations); |
| 37 #endif | |
| 38 } | 36 } |
| 39 | 37 |
| 40 void SampledEffect::applySVGUpdate(SVGElement& targetElement) | 38 void SampledEffect::applySVGUpdate(SVGElement& targetElement) |
| 41 { | 39 { |
| 42 for (const auto& interpolation : *m_interpolations) { | 40 for (const auto& interpolation : *m_interpolations) { |
| 43 if (interpolation->isSVGInterpolation()) { | 41 if (interpolation->isSVGInterpolation()) { |
| 44 toSVGInterpolation(interpolation.get())->apply(targetElement); | 42 toSVGInterpolation(interpolation.get())->apply(targetElement); |
| 45 } | 43 } |
| 46 } | 44 } |
| 47 } | 45 } |
| 48 | 46 |
| 49 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |