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
80 lines
3.0 KiB
C++
80 lines
3.0 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.
|
|
|
|
#ifndef StringKeyframe_h
|
|
#define StringKeyframe_h
|
|
|
|
#include "core/animation/Keyframe.h"
|
|
#include "core/css/StylePropertySet.h"
|
|
|
|
namespace blink {
|
|
|
|
class StyleSheetContents;
|
|
|
|
class StringKeyframe : public Keyframe {
|
|
public:
|
|
static PassRefPtr<StringKeyframe> create()
|
|
{
|
|
return adoptRef(new StringKeyframe);
|
|
}
|
|
void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents*);
|
|
void clearPropertyValue(CSSPropertyID property) { m_propertySet->removeProperty(property); }
|
|
CSSValue* propertyValue(CSSPropertyID property) const
|
|
{
|
|
int index = m_propertySet->findPropertyIndex(property);
|
|
RELEASE_ASSERT(index >= 0);
|
|
return m_propertySet->propertyAt(static_cast<unsigned>(index)).value();
|
|
}
|
|
virtual PropertySet properties() const override;
|
|
|
|
virtual void trace(Visitor*) override;
|
|
|
|
class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
|
|
public:
|
|
PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue*, AnimationEffect::CompositeOperation);
|
|
|
|
CSSValue* value() const { return m_value.get(); }
|
|
virtual const PassRefPtr<AnimatableValue> getAnimatableValue() const override final {
|
|
return m_animatableValueCache.get();
|
|
}
|
|
|
|
virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override final;
|
|
virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, blink::Keyframe::PropertySpecificKeyframe* end, Element*) const override final;
|
|
|
|
virtual void trace(Visitor*) override;
|
|
|
|
private:
|
|
PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue*);
|
|
|
|
virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(double offset) const;
|
|
virtual bool isStringPropertySpecificKeyframe() const override { return true; }
|
|
|
|
RefPtr<CSSValue> m_value;
|
|
mutable RefPtr<AnimatableValue> m_animatableValueCache;
|
|
};
|
|
|
|
private:
|
|
StringKeyframe()
|
|
: m_propertySet(MutableStylePropertySet::create())
|
|
{ }
|
|
|
|
StringKeyframe(const StringKeyframe& copyFrom);
|
|
|
|
virtual PassRefPtr<Keyframe> clone() const override;
|
|
virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecificKeyframe(CSSPropertyID) const override;
|
|
|
|
virtual bool isStringKeyframe() const override { return true; }
|
|
|
|
RefPtr<MutableStylePropertySet> m_propertySet;
|
|
};
|
|
|
|
typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe;
|
|
|
|
DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), value.isStringKeyframe());
|
|
DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyframe, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySpecificKeyframe());
|
|
|
|
}
|
|
|
|
#endif
|