| 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 30 matching lines...) Expand all Loading... |
| 41 class AnimatableValue : public RefCounted<AnimatableValue> { | 41 class AnimatableValue : public RefCounted<AnimatableValue> { |
| 42 public: | 42 public: |
| 43 virtual ~AnimatableValue() { } | 43 virtual ~AnimatableValue() { } |
| 44 | 44 |
| 45 static const AnimatableValue* neutralValue(); | 45 static const AnimatableValue* neutralValue(); |
| 46 | 46 |
| 47 static PassRefPtr<AnimatableValue> interpolate(const AnimatableValue*, const
AnimatableValue*, double fraction); | 47 static PassRefPtr<AnimatableValue> interpolate(const AnimatableValue*, const
AnimatableValue*, double fraction); |
| 48 // For noncommutative values read add(A, B) to mean the value A with B compo
sed onto it. | 48 // For noncommutative values read add(A, B) to mean the value A with B compo
sed onto it. |
| 49 static PassRefPtr<AnimatableValue> add(const AnimatableValue*, const Animata
bleValue*); | 49 static PassRefPtr<AnimatableValue> add(const AnimatableValue*, const Animata
bleValue*); |
| 50 | 50 |
| 51 bool isImage() const { return m_type == TypeImage; } |
| 52 bool isLengthBox() const { return m_type == TypeLengthBox; } |
| 51 bool isNumber() const { return m_type == TypeNumber; } | 53 bool isNumber() const { return m_type == TypeNumber; } |
| 52 bool isNeutral() const { return m_type == TypeNeutral; } | 54 bool isNeutral() const { return m_type == TypeNeutral; } |
| 53 bool isTransform() const { return m_type == TypeTransform; } | 55 bool isTransform() const { return m_type == TypeTransform; } |
| 54 bool isUnknown() const { return m_type == TypeUnknown; } | 56 bool isUnknown() const { return m_type == TypeUnknown; } |
| 55 | 57 |
| 56 protected: | 58 protected: |
| 57 enum AnimatableType { | 59 enum AnimatableType { |
| 60 TypeImage, |
| 61 TypeLengthBox, |
| 58 TypeNeutral, | 62 TypeNeutral, |
| 59 TypeNumber, | 63 TypeNumber, |
| 60 TypeTransform, | 64 TypeTransform, |
| 61 TypeUnknown, | 65 TypeUnknown, |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 AnimatableValue(AnimatableType type) : m_type(type) { } | 68 AnimatableValue(AnimatableType type) : m_type(type) { } |
| 65 | 69 |
| 66 bool isSameType(const AnimatableValue* value) const | 70 bool isSameType(const AnimatableValue* value) const |
| 67 { | 71 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 78 | 82 |
| 79 template <class T> | 83 template <class T> |
| 80 static PassRefPtr<T> takeConstRef(const T* value) { return PassRefPtr<T>(con
st_cast<T*>(value)); } | 84 static PassRefPtr<T> takeConstRef(const T* value) { return PassRefPtr<T>(con
st_cast<T*>(value)); } |
| 81 | 85 |
| 82 const AnimatableType m_type; | 86 const AnimatableType m_type; |
| 83 }; | 87 }; |
| 84 | 88 |
| 85 } // namespace WebCore | 89 } // namespace WebCore |
| 86 | 90 |
| 87 #endif // AnimatableValue_h | 91 #endif // AnimatableValue_h |
| OLD | NEW |