| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "core/animation/AnimatableColor.h" | 34 #include "core/animation/AnimatableColor.h" |
| 35 #include "core/animation/AnimatableValue.h" | 35 #include "core/animation/AnimatableValue.h" |
| 36 #include "core/svg/SVGPaint.h" | 36 #include "core/svg/SVGPaint.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 class AnimatableSVGPaint FINAL : public AnimatableValue { | 40 class AnimatableSVGPaint FINAL : public AnimatableValue { |
| 41 public: | 41 public: |
| 42 virtual ~AnimatableSVGPaint() { } | 42 virtual ~AnimatableSVGPaint() { } |
| 43 static PassRefPtr<AnimatableSVGPaint> create(SVGPaint::SVGPaintType type, co
nst Color& color, const String& uri) | 43 static PassRefPtrWillBeRawPtr<AnimatableSVGPaint> create(SVGPaint::SVGPaintT
ype type, const Color& color, const String& uri) |
| 44 { | 44 { |
| 45 return create(type, AnimatableColorImpl(color), uri); | 45 return create(type, AnimatableColorImpl(color), uri); |
| 46 } | 46 } |
| 47 static PassRefPtr<AnimatableSVGPaint> create(SVGPaint::SVGPaintType type, co
nst AnimatableColorImpl& color, const String& uri) | 47 static PassRefPtrWillBeRawPtr<AnimatableSVGPaint> create(SVGPaint::SVGPaintT
ype type, const AnimatableColorImpl& color, const String& uri) |
| 48 { | 48 { |
| 49 return adoptRef(new AnimatableSVGPaint(type, color, uri)); | 49 return adoptRefWillBeNoop(new AnimatableSVGPaint(type, color, uri)); |
| 50 } | 50 } |
| 51 SVGPaint::SVGPaintType paintType() const { return m_type; }; | 51 SVGPaint::SVGPaintType paintType() const { return m_type; }; |
| 52 Color color() const { return m_color.toColor(); }; | 52 Color color() const { return m_color.toColor(); }; |
| 53 const String& uri() const { return m_uri; }; | 53 const String& uri() const { return m_uri; }; |
| 54 | 54 |
| 55 virtual void trace(Visitor*) OVERRIDE { } |
| 56 |
| 55 protected: | 57 protected: |
| 56 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do
uble fraction) const OVERRIDE; | 58 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab
leValue*, double fraction) const OVERRIDE; |
| 57 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV
ERRIDE; | 59 virtual PassRefPtrWillBeRawPtr<AnimatableValue> addWith(const AnimatableValu
e*) const OVERRIDE; |
| 58 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const OVER
RIDE; | 60 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const OVER
RIDE; |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 AnimatableSVGPaint(SVGPaint::SVGPaintType type, const AnimatableColorImpl& c
olor, const String& uri) | 63 AnimatableSVGPaint(SVGPaint::SVGPaintType type, const AnimatableColorImpl& c
olor, const String& uri) |
| 62 : m_type(type) | 64 : m_type(type) |
| 63 , m_color(color) | 65 , m_color(color) |
| 64 , m_uri(uri) | 66 , m_uri(uri) |
| 65 { | 67 { |
| 66 } | 68 } |
| 67 virtual AnimatableType type() const OVERRIDE { return TypeSVGPaint; } | 69 virtual AnimatableType type() const OVERRIDE { return TypeSVGPaint; } |
| 68 virtual bool equalTo(const AnimatableValue*) const OVERRIDE; | 70 virtual bool equalTo(const AnimatableValue*) const OVERRIDE; |
| 69 | 71 |
| 70 SVGPaint::SVGPaintType m_type; | 72 SVGPaint::SVGPaintType m_type; |
| 71 AnimatableColorImpl m_color; | 73 AnimatableColorImpl m_color; |
| 72 String m_uri; | 74 String m_uri; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableSVGPaint, isSVGPaint()); | 77 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableSVGPaint, isSVGPaint()); |
| 76 | 78 |
| 77 } // namespace WebCore | 79 } // namespace WebCore |
| 78 | 80 |
| 79 #endif // AnimatableSVGPaint_h | 81 #endif // AnimatableSVGPaint_h |
| OLD | NEW |