mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
I used do-webcore-rename from Blink/WebKit which is very good at doing this kind of search-replace. Also removed toRefPrtNativeArray after conversion since it previously had two separate flavors. Both versions are no longer used so I've removed the code until we need one again. https://www.irccloud.com/pastebin/5C16p5cE is the diff I used to do-webcore-rename TBR=abarth@chromium.org
67 lines
1.7 KiB
C++
67 lines
1.7 KiB
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "config.h"
|
|
#include "core/animation/SampledEffect.h"
|
|
|
|
#include "core/animation/StyleInterpolation.h"
|
|
|
|
namespace blink {
|
|
|
|
SampledEffect::SampledEffect(Animation* animation, PassOwnPtr<Vector<RefPtr<Interpolation> > > interpolations)
|
|
: m_animation(animation)
|
|
#if !ENABLE(OILPAN)
|
|
, m_player(animation->player())
|
|
#endif
|
|
, m_interpolations(interpolations)
|
|
, m_sequenceNumber(animation->player()->sequenceNumber())
|
|
, m_priority(animation->priority())
|
|
{
|
|
ASSERT(m_interpolations && !m_interpolations->isEmpty());
|
|
}
|
|
|
|
bool SampledEffect::canChange() const
|
|
{
|
|
#if ENABLE(OILPAN)
|
|
return m_animation;
|
|
#else
|
|
if (!m_animation)
|
|
return false;
|
|
// FIXME: This check won't be needed when Animation and AnimationPlayer are moved to Oilpan.
|
|
return !m_player->canFree();
|
|
#endif
|
|
}
|
|
|
|
void SampledEffect::clear()
|
|
{
|
|
#if !ENABLE(OILPAN)
|
|
m_player = nullptr;
|
|
#endif
|
|
m_animation = nullptr;
|
|
m_interpolations->clear();
|
|
}
|
|
|
|
void SampledEffect::removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>& replacedProperties)
|
|
{
|
|
if (canChange() && m_animation->isCurrent())
|
|
return;
|
|
|
|
size_t dest = 0;
|
|
for (size_t i = 0; i < m_interpolations->size(); i++) {
|
|
if (!replacedProperties.get(toStyleInterpolation(m_interpolations->at(i).get())->id()))
|
|
m_interpolations->at(dest++) = m_interpolations->at(i);
|
|
}
|
|
m_interpolations->shrink(dest);
|
|
}
|
|
|
|
void SampledEffect::trace(Visitor* visitor)
|
|
{
|
|
visitor->trace(m_animation);
|
|
#if ENABLE(OILPAN)
|
|
visitor->trace(m_interpolations);
|
|
#endif
|
|
}
|
|
|
|
} // namespace blink
|