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 namespace WebCore { | 8 namespace WebCore { |
9 | 9 |
10 SampledEffect::SampledEffect(Animation* animation, PassOwnPtrWillBeRawPtr<WillBe
HeapVector<RefPtrWillBeMember<Interpolation> > > interpolations) | 10 SampledEffect::SampledEffect(Animation* animation, PassOwnPtrWillBeRawPtr<WillBe
HeapVector<RefPtrWillBeMember<Interpolation> > > interpolations) |
11 : m_player(animation->player()) | 11 : m_animation(animation) |
12 , m_animation(animation) | 12 #if !ENABLE(OILPAN) |
| 13 , m_player(animation->player()) |
| 14 #endif |
13 , m_interpolations(interpolations) | 15 , m_interpolations(interpolations) |
14 , m_playerSortInfo(m_player->sortInfo()) | 16 , m_playerSortInfo(animation->player()->sortInfo()) |
15 , m_priority(animation->priority()) | 17 , m_priority(animation->priority()) |
16 { | 18 { |
17 ASSERT(m_interpolations && !m_interpolations->isEmpty()); | 19 ASSERT(m_interpolations && !m_interpolations->isEmpty()); |
18 } | 20 } |
19 | 21 |
20 bool SampledEffect::canChange() const | 22 bool SampledEffect::canChange() const |
21 { | 23 { |
| 24 #if ENABLE(OILPAN) |
| 25 return m_animation; |
| 26 #else |
22 if (!m_animation) | 27 if (!m_animation) |
23 return false; | 28 return false; |
24 // FIXME: This check won't be needed when Animation and AnimationPlayer are
moved to Oilpan. | 29 // FIXME: This check won't be needed when Animation and AnimationPlayer are
moved to Oilpan. |
25 return !m_player->canFree(); | 30 return !m_player->canFree(); |
| 31 #endif |
26 } | 32 } |
27 | 33 |
28 void SampledEffect::clear() | 34 void SampledEffect::clear() |
29 { | 35 { |
30 m_player.clear(); | 36 #if !ENABLE(OILPAN) |
31 m_animation = 0; | 37 m_player = nullptr; |
| 38 #endif |
| 39 m_animation = nullptr; |
32 m_interpolations->clear(); | 40 m_interpolations->clear(); |
33 } | 41 } |
34 | 42 |
35 void SampledEffect::removeReplacedInterpolationsIfNeeded(const BitArray<numCSSPr
operties>& replacedProperties) | 43 void SampledEffect::removeReplacedInterpolationsIfNeeded(const BitArray<numCSSPr
operties>& replacedProperties) |
36 { | 44 { |
37 if (canChange() && m_animation->isCurrent()) | 45 if (canChange() && m_animation->isCurrent()) |
38 return; | 46 return; |
39 | 47 |
40 size_t dest = 0; | 48 size_t dest = 0; |
41 for (size_t i = 0; i < m_interpolations->size(); i++) { | 49 for (size_t i = 0; i < m_interpolations->size(); i++) { |
42 if (!replacedProperties.get(toStyleInterpolation(m_interpolations->at(i)
.get())->id())) | 50 if (!replacedProperties.get(toStyleInterpolation(m_interpolations->at(i)
.get())->id())) |
43 m_interpolations->at(dest++) = m_interpolations->at(i); | 51 m_interpolations->at(dest++) = m_interpolations->at(i); |
44 } | 52 } |
45 m_interpolations->shrink(dest); | 53 m_interpolations->shrink(dest); |
46 } | 54 } |
47 | 55 |
| 56 void SampledEffect::trace(Visitor* visitor) |
| 57 { |
| 58 visitor->trace(m_animation); |
| 59 #if ENABLE(OILPAN) |
| 60 visitor->trace(m_interpolations); |
| 61 #endif |
| 62 } |
| 63 |
48 } // namespace WebCore | 64 } // namespace WebCore |
OLD | NEW |