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