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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 float m_green; | 53 float m_green; |
54 float m_blue; | 54 float m_blue; |
55 }; | 55 }; |
56 | 56 |
57 // This class handles both the regular and 'visted link' colors for a given | 57 // This class handles both the regular and 'visted link' colors for a given |
58 // property. Currently it is used for all properties, even those which do not | 58 // property. Currently it is used for all properties, even those which do not |
59 // support a separate 'visited link' color (eg SVG properties). This is correct | 59 // support a separate 'visited link' color (eg SVG properties). This is correct |
60 // but inefficient. | 60 // but inefficient. |
61 class CORE_EXPORT AnimatableColor final : public AnimatableValue { | 61 class CORE_EXPORT AnimatableColor final : public AnimatableValue { |
62 public: | 62 public: |
63 static PassRefPtrWillBeRawPtr<AnimatableColor> create(const AnimatableColorI
mpl&, const AnimatableColorImpl& visitedLinkColor); | 63 static PassRefPtr<AnimatableColor> create(const AnimatableColorImpl&, const
AnimatableColorImpl& visitedLinkColor); |
64 Color color() const { return m_color.toColor(); } | 64 Color color() const { return m_color.toColor(); } |
65 Color visitedLinkColor() const { return m_visitedLinkColor.toColor(); } | 65 Color visitedLinkColor() const { return m_visitedLinkColor.toColor(); } |
66 | 66 |
67 DEFINE_INLINE_VIRTUAL_TRACE() { AnimatableValue::trace(visitor); } | |
68 | |
69 protected: | 67 protected: |
70 PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*
, double fraction) const override; | 68 PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fra
ction) const override; |
71 | 69 |
72 private: | 70 private: |
73 AnimatableColor(const AnimatableColorImpl& color, const AnimatableColorImpl&
visitedLinkColor) | 71 AnimatableColor(const AnimatableColorImpl& color, const AnimatableColorImpl&
visitedLinkColor) |
74 : m_color(color) | 72 : m_color(color) |
75 , m_visitedLinkColor(visitedLinkColor) | 73 , m_visitedLinkColor(visitedLinkColor) |
76 { | 74 { |
77 } | 75 } |
78 AnimatableType type() const override { return TypeColor; } | 76 AnimatableType type() const override { return TypeColor; } |
79 bool equalTo(const AnimatableValue*) const override; | 77 bool equalTo(const AnimatableValue*) const override; |
80 const AnimatableColorImpl m_color; | 78 const AnimatableColorImpl m_color; |
81 const AnimatableColorImpl m_visitedLinkColor; | 79 const AnimatableColorImpl m_visitedLinkColor; |
82 }; | 80 }; |
83 | 81 |
84 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableColor, isColor()); | 82 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableColor, isColor()); |
85 | 83 |
86 } // namespace blink | 84 } // namespace blink |
87 | 85 |
88 #endif // AnimatableColor_h | 86 #endif // AnimatableColor_h |
OLD | NEW |