| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class AffineTransform; | 40 class AffineTransform; |
| 41 class SVGPointTearOff; | 41 class SVGPointTearOff; |
| 42 | 42 |
| 43 class SVGPoint : public SVGPropertyHelper<SVGPoint> { | 43 class SVGPoint : public SVGPropertyHelper<SVGPoint> { |
| 44 public: | 44 public: |
| 45 typedef SVGPointTearOff TearOffType; | 45 typedef SVGPointTearOff TearOffType; |
| 46 | 46 |
| 47 static PassRefPtrWillBeRawPtr<SVGPoint> create() | 47 static RawPtr<SVGPoint> create() |
| 48 { | 48 { |
| 49 return adoptRefWillBeNoop(new SVGPoint()); | 49 return new SVGPoint(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 static PassRefPtrWillBeRawPtr<SVGPoint> create(const FloatPoint& point) | 52 static RawPtr<SVGPoint> create(const FloatPoint& point) |
| 53 { | 53 { |
| 54 return adoptRefWillBeNoop(new SVGPoint(point)); | 54 return new SVGPoint(point); |
| 55 } | 55 } |
| 56 | 56 |
| 57 PassRefPtrWillBeRawPtr<SVGPoint> clone() const; | 57 RawPtr<SVGPoint> clone() const; |
| 58 | 58 |
| 59 const FloatPoint& value() const { return m_value; } | 59 const FloatPoint& value() const { return m_value; } |
| 60 void setValue(const FloatPoint& value) { m_value = value; } | 60 void setValue(const FloatPoint& value) { m_value = value; } |
| 61 | 61 |
| 62 float x() const { return m_value.x(); } | 62 float x() const { return m_value.x(); } |
| 63 float y() const { return m_value.y(); } | 63 float y() const { return m_value.y(); } |
| 64 void setX(float f) { m_value.setX(f); } | 64 void setX(float f) { m_value.setX(f); } |
| 65 void setY(float f) { m_value.setY(f); } | 65 void setY(float f) { m_value.setY(f); } |
| 66 | 66 |
| 67 FloatPoint matrixTransform(const AffineTransform&) const; | 67 FloatPoint matrixTransform(const AffineTransform&) const; |
| 68 | 68 |
| 69 String valueAsString() const override; | 69 String valueAsString() const override; |
| 70 SVGParsingError setValueAsString(const String&); | 70 SVGParsingError setValueAsString(const String&); |
| 71 | 71 |
| 72 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 72 void add(RawPtr<SVGPropertyBase>, SVGElement*) override; |
| 73 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; | 73 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, RawPtr<SVGPropertyBase> from, RawPtr<SVGPropertyBase> to, RawPtr<S
VGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement) override; |
| 74 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; | 74 float calculateDistance(RawPtr<SVGPropertyBase> to, SVGElement* contextEleme
nt) override; |
| 75 | 75 |
| 76 static AnimatedPropertyType classType() { return AnimatedPoint; } | 76 static AnimatedPropertyType classType() { return AnimatedPoint; } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 SVGPoint(); | 79 SVGPoint(); |
| 80 explicit SVGPoint(const FloatPoint&); | 80 explicit SVGPoint(const FloatPoint&); |
| 81 | 81 |
| 82 template<typename CharType> | 82 template<typename CharType> |
| 83 SVGParsingError parse(const CharType*& ptr, const CharType* end); | 83 SVGParsingError parse(const CharType*& ptr, const CharType* end); |
| 84 | 84 |
| 85 FloatPoint m_value; | 85 FloatPoint m_value; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPoint); | 88 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPoint); |
| 89 | 89 |
| 90 } // namespace blink | 90 } // namespace blink |
| 91 | 91 |
| 92 #endif // SVGPoint_h | 92 #endif // SVGPoint_h |
| OLD | NEW |