| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 // This class represents collections of values that animate in a repeated fashio
n as described by the CSS Transitions spec: | 39 // This class represents collections of values that animate in a repeated fashio
n as described by the CSS Transitions spec: |
| 40 // http://www.w3.org/TR/css3-transitions/#animtype-repeatable-list | 40 // http://www.w3.org/TR/css3-transitions/#animtype-repeatable-list |
| 41 class AnimatableRepeatable : public AnimatableValue { | 41 class AnimatableRepeatable : public AnimatableValue { |
| 42 public: | 42 public: |
| 43 virtual ~AnimatableRepeatable() { } | 43 virtual ~AnimatableRepeatable() { } |
| 44 | 44 |
| 45 // This will consume the vector passed into it. | 45 // This will consume the vector passed into it. |
| 46 static PassRefPtrWillBeRawPtr<AnimatableRepeatable> create(WillBeHeapVector<
RefPtrWillBeMember<AnimatableValue> >& values) | 46 static PassRefPtrWillBeRawPtr<AnimatableRepeatable> create(WillBeHeapVector<
RefPtrWillBeMember<AnimatableValue>>& values) |
| 47 { | 47 { |
| 48 return adoptRefWillBeNoop(new AnimatableRepeatable(values)); | 48 return adoptRefWillBeNoop(new AnimatableRepeatable(values)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 const WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> >& values() const
{ return m_values; } | 51 const WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>>& values() const
{ return m_values; } |
| 52 | 52 |
| 53 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
| 54 | 54 |
| 55 protected: | 55 protected: |
| 56 AnimatableRepeatable() | 56 AnimatableRepeatable() |
| 57 { | 57 { |
| 58 } | 58 } |
| 59 AnimatableRepeatable(WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> >&
values) | 59 AnimatableRepeatable(WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>>&
values) |
| 60 { | 60 { |
| 61 ASSERT(!values.isEmpty()); | 61 ASSERT(!values.isEmpty()); |
| 62 m_values.swap(values); | 62 m_values.swap(values); |
| 63 } | 63 } |
| 64 | 64 |
| 65 static bool interpolateLists(const WillBeHeapVector<RefPtrWillBeMember<Anima
tableValue> >& fromValues, const WillBeHeapVector<RefPtrWillBeMember<AnimatableV
alue> >& toValues, double fraction, WillBeHeapVector<RefPtrWillBeMember<Animatab
leValue> >& interpolatedValues); | 65 static bool interpolateLists(const WillBeHeapVector<RefPtrWillBeMember<Anima
tableValue>>& fromValues, const WillBeHeapVector<RefPtrWillBeMember<AnimatableVa
lue>>& toValues, double fraction, WillBeHeapVector<RefPtrWillBeMember<Animatable
Value>>& interpolatedValues); |
| 66 | 66 |
| 67 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const over
ride; | 67 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const over
ride; |
| 68 | 68 |
| 69 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > m_values; | 69 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>> m_values; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab
leValue*, double fraction) const override; | 72 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab
leValue*, double fraction) const override; |
| 73 | 73 |
| 74 virtual AnimatableType type() const override { return TypeRepeatable; } | 74 virtual AnimatableType type() const override { return TypeRepeatable; } |
| 75 virtual bool equalTo(const AnimatableValue*) const override final; | 75 virtual bool equalTo(const AnimatableValue*) const override final; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat
able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro
keDasharrayList())); | 78 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat
able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro
keDasharrayList())); |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| 81 | 81 |
| 82 #endif // AnimatableRepeatable_h | 82 #endif // AnimatableRepeatable_h |
| OLD | NEW |