| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 PassRefPtr<AnimatableRepeatable> create(Vector<RefPtr<AnimatableValue
> >& values) | 46 static PassRefPtr<AnimatableRepeatable> create(Vector<RefPtr<AnimatableValue
> >& values) |
| 47 { | 47 { |
| 48 return adoptRef(new AnimatableRepeatable(values)); | 48 return adoptRef(new AnimatableRepeatable(values)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 const Vector<RefPtr<AnimatableValue> >& values() const { return m_values; } | 51 const Vector<RefPtr<AnimatableValue> >& values() const { return m_values; } |
| 52 | 52 |
| 53 virtual void trace(Visitor*) override; | |
| 54 | |
| 55 protected: | 53 protected: |
| 56 AnimatableRepeatable() | 54 AnimatableRepeatable() |
| 57 { | 55 { |
| 58 } | 56 } |
| 59 AnimatableRepeatable(Vector<RefPtr<AnimatableValue> >& values) | 57 AnimatableRepeatable(Vector<RefPtr<AnimatableValue> >& values) |
| 60 { | 58 { |
| 61 ASSERT(!values.isEmpty()); | 59 ASSERT(!values.isEmpty()); |
| 62 m_values.swap(values); | 60 m_values.swap(values); |
| 63 } | 61 } |
| 64 | 62 |
| 65 static bool interpolateLists(const Vector<RefPtr<AnimatableValue> >& fromVal
ues, const Vector<RefPtr<AnimatableValue> >& toValues, double fraction, Vector<R
efPtr<AnimatableValue> >& interpolatedValues); | 63 static bool interpolateLists(const Vector<RefPtr<AnimatableValue> >& fromVal
ues, const Vector<RefPtr<AnimatableValue> >& toValues, double fraction, Vector<R
efPtr<AnimatableValue> >& interpolatedValues); |
| 66 | 64 |
| 67 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const over
ride; | 65 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const over
ride; |
| 68 | 66 |
| 69 Vector<RefPtr<AnimatableValue> > m_values; | 67 Vector<RefPtr<AnimatableValue> > m_values; |
| 70 | 68 |
| 71 private: | 69 private: |
| 72 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do
uble fraction) const override; | 70 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do
uble fraction) const override; |
| 73 | 71 |
| 74 virtual AnimatableType type() const override { return TypeRepeatable; } | 72 virtual AnimatableType type() const override { return TypeRepeatable; } |
| 75 virtual bool equalTo(const AnimatableValue*) const override final; | 73 virtual bool equalTo(const AnimatableValue*) const override final; |
| 76 }; | 74 }; |
| 77 | 75 |
| 78 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat
able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro
keDasharrayList())); | 76 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat
able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro
keDasharrayList())); |
| 79 | 77 |
| 80 } // namespace blink | 78 } // namespace blink |
| 81 | 79 |
| 82 #endif // AnimatableRepeatable_h | 80 #endif // AnimatableRepeatable_h |
| OLD | NEW |