| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 // This class represents collections of values that animate in a repeated fashio
n as described by the CSS Transitions spec: | 40 // This class represents collections of values that animate in a repeated fashio
n as described by the CSS Transitions spec: |
| 41 // http://www.w3.org/TR/css3-transitions/#animtype-repeatable-list | 41 // http://www.w3.org/TR/css3-transitions/#animtype-repeatable-list |
| 42 class CORE_EXPORT AnimatableRepeatable : public AnimatableValue { | 42 class CORE_EXPORT AnimatableRepeatable : public AnimatableValue { |
| 43 public: | 43 public: |
| 44 ~AnimatableRepeatable() override { } | 44 ~AnimatableRepeatable() override { } |
| 45 | 45 |
| 46 // This will consume the vector passed into it. | 46 // This will consume the vector passed into it. |
| 47 static PassRefPtrWillBeRawPtr<AnimatableRepeatable> create(WillBeHeapVector<
RefPtrWillBeMember<AnimatableValue>>& values) | 47 static PassRefPtr<AnimatableRepeatable> create(Vector<RefPtr<AnimatableValue
>>& values) |
| 48 { | 48 { |
| 49 return adoptRefWillBeNoop(new AnimatableRepeatable(values)); | 49 return adoptRef(new AnimatableRepeatable(values)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 const WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>>& values() const
{ return m_values; } | 52 const Vector<RefPtr<AnimatableValue>>& values() const { return m_values; } |
| 53 | |
| 54 DECLARE_VIRTUAL_TRACE(); | |
| 55 | 53 |
| 56 protected: | 54 protected: |
| 57 AnimatableRepeatable() | 55 AnimatableRepeatable() |
| 58 { | 56 { |
| 59 } | 57 } |
| 60 AnimatableRepeatable(WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>>&
values) | 58 AnimatableRepeatable(Vector<RefPtr<AnimatableValue>>& values) |
| 61 { | 59 { |
| 62 ASSERT(!values.isEmpty()); | 60 ASSERT(!values.isEmpty()); |
| 63 m_values.swap(values); | 61 m_values.swap(values); |
| 64 } | 62 } |
| 65 | 63 |
| 66 static bool interpolateLists(const WillBeHeapVector<RefPtrWillBeMember<Anima
tableValue>>& fromValues, const WillBeHeapVector<RefPtrWillBeMember<AnimatableVa
lue>>& toValues, double fraction, WillBeHeapVector<RefPtrWillBeMember<Animatable
Value>>& interpolatedValues); | 64 static bool interpolateLists(const Vector<RefPtr<AnimatableValue>>& fromValu
es, const Vector<RefPtr<AnimatableValue>>& toValues, double fraction, Vector<Ref
Ptr<AnimatableValue>>& interpolatedValues); |
| 67 | 65 |
| 68 bool usesDefaultInterpolationWith(const AnimatableValue*) const override; | 66 bool usesDefaultInterpolationWith(const AnimatableValue*) const override; |
| 69 | 67 |
| 70 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>> m_values; | 68 Vector<RefPtr<AnimatableValue>> m_values; |
| 71 | 69 |
| 72 private: | 70 private: |
| 73 PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*
, double fraction) const override; | 71 PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fra
ction) const override; |
| 74 | 72 |
| 75 AnimatableType type() const override { return TypeRepeatable; } | 73 AnimatableType type() const override { return TypeRepeatable; } |
| 76 bool equalTo(const AnimatableValue*) const final; | 74 bool equalTo(const AnimatableValue*) const final; |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat
able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro
keDasharrayList())); | 77 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat
able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro
keDasharrayList())); |
| 80 | 78 |
| 81 } // namespace blink | 79 } // namespace blink |
| 82 | 80 |
| 83 #endif // AnimatableRepeatable_h | 81 #endif // AnimatableRepeatable_h |
| OLD | NEW |