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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 CSSValueID ToCSSValueID() const { | 52 CSSValueID ToCSSValueID() const { |
53 return ToCSSIdentifierValue(value_.Get())->GetValueID(); | 53 return ToCSSIdentifierValue(value_.Get())->GetValueID(); |
54 } | 54 } |
55 | 55 |
56 protected: | 56 protected: |
57 PassRefPtr<AnimatableValue> InterpolateTo(const AnimatableValue* value, | 57 PassRefPtr<AnimatableValue> InterpolateTo(const AnimatableValue* value, |
58 double fraction) const override { | 58 double fraction) const override { |
59 return DefaultInterpolateTo(this, value, fraction); | 59 return DefaultInterpolateTo(this, value, fraction); |
60 } | 60 } |
61 | 61 |
62 bool UsesDefaultInterpolationWith(const AnimatableValue*) const override; | |
63 | |
64 private: | 62 private: |
65 explicit AnimatableUnknown(const CSSValue* value) : value_(value) {} | 63 explicit AnimatableUnknown(const CSSValue* value) : value_(value) {} |
66 AnimatableType GetType() const override { return kTypeUnknown; } | 64 AnimatableType GetType() const override { return kTypeUnknown; } |
67 bool EqualTo(const AnimatableValue*) const override; | |
68 | 65 |
69 const Persistent<const CSSValue> value_; | 66 const Persistent<const CSSValue> value_; |
70 }; | 67 }; |
71 | 68 |
72 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableUnknown, IsUnknown()); | 69 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableUnknown, IsUnknown()); |
73 | 70 |
74 inline bool AnimatableUnknown::EqualTo(const AnimatableValue* value) const { | |
75 const AnimatableUnknown* unknown = ToAnimatableUnknown(value); | |
76 return DataEquivalent(value_, unknown->value_); | |
77 } | |
78 | |
79 inline bool AnimatableUnknown::UsesDefaultInterpolationWith( | |
80 const AnimatableValue* value) const { | |
81 return !EqualTo(value); | |
82 } | |
83 | |
84 } // namespace blink | 71 } // namespace blink |
85 | 72 |
86 #endif // AnimatableUnknown_h | 73 #endif // AnimatableUnknown_h |
OLD | NEW |