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
3 // found in the LICENSE file.
6 #include "core/animation/SampledEffect.h"
10 SampledEffect::SampledEffect(Animation* animation, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > interpolations)
11 : m_player(animation->player())
12 , m_animation(animation)
13 , m_interpolations(interpolations)
14 , m_playerSortInfo(m_player->sortInfo())
15 , m_priority(animation->priority())
17 ASSERT(m_interpolations && !m_interpolations->isEmpty());
20 bool SampledEffect::canChange() const
24 // FIXME: This check won't be needed when Animation and AnimationPlayer are moved to Oilpan.
25 return !m_player->canFree();
28 void SampledEffect::clear()
32 m_interpolations->clear();
35 void SampledEffect::removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>& replacedProperties)
37 if (canChange() && m_animation->isCurrent())
41 for (size_t i = 0; i < m_interpolations->size(); i++) {
42 if (!replacedProperties.get(toStyleInterpolation(m_interpolations->at(i).get())->id()))
43 m_interpolations->at(dest++) = m_interpolations->at(i);
45 m_interpolations->shrink(dest);
48 } // namespace WebCore