| 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 27 matching lines...) Expand all Loading... |
| 38 #include "platform/transforms/AffineTransform.h" | 38 #include "platform/transforms/AffineTransform.h" |
| 39 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class SVGTransformTearOff; | 43 class SVGTransformTearOff; |
| 44 | 44 |
| 45 // SVGMatrixTearOff wraps a AffineTransform for Javascript. | 45 // SVGMatrixTearOff wraps a AffineTransform for Javascript. |
| 46 // Its instance can either hold a static value, or this can be teared off from |
SVGTransform.matrix|. | 46 // Its instance can either hold a static value, or this can be teared off from |
SVGTransform.matrix|. |
| 47 // This does not derive from SVGPropertyTearOff, as its instances are never tied
to an animated property nor an XML attribute. | 47 // This does not derive from SVGPropertyTearOff, as its instances are never tied
to an animated property nor an XML attribute. |
| 48 class CORE_EXPORT SVGMatrixTearOff final : public RefCountedWillBeGarbageCollect
edFinalized<SVGMatrixTearOff>, public ScriptWrappable { | 48 class CORE_EXPORT SVGMatrixTearOff final : public GarbageCollectedFinalized<SVGM
atrixTearOff>, public ScriptWrappable { |
| 49 DEFINE_WRAPPERTYPEINFO(); | 49 DEFINE_WRAPPERTYPEINFO(); |
| 50 public: | 50 public: |
| 51 static PassRefPtrWillBeRawPtr<SVGMatrixTearOff> create(const AffineTransform
& value) | 51 static RawPtr<SVGMatrixTearOff> create(const AffineTransform& value) |
| 52 { | 52 { |
| 53 return adoptRefWillBeNoop(new SVGMatrixTearOff(value)); | 53 return new SVGMatrixTearOff(value); |
| 54 } | 54 } |
| 55 | 55 |
| 56 static PassRefPtrWillBeRawPtr<SVGMatrixTearOff> create(SVGTransformTearOff*
target) | 56 static RawPtr<SVGMatrixTearOff> create(SVGTransformTearOff* target) |
| 57 { | 57 { |
| 58 return adoptRefWillBeNoop(new SVGMatrixTearOff(target)); | 58 return new SVGMatrixTearOff(target); |
| 59 } | 59 } |
| 60 | 60 |
| 61 ~SVGMatrixTearOff(); | 61 ~SVGMatrixTearOff(); |
| 62 | 62 |
| 63 double a() { return value().a(); } | 63 double a() { return value().a(); } |
| 64 double b() { return value().b(); } | 64 double b() { return value().b(); } |
| 65 double c() { return value().c(); } | 65 double c() { return value().c(); } |
| 66 double d() { return value().d(); } | 66 double d() { return value().d(); } |
| 67 double e() { return value().e(); } | 67 double e() { return value().e(); } |
| 68 double f() { return value().f(); } | 68 double f() { return value().f(); } |
| 69 | 69 |
| 70 void setA(double, ExceptionState&); | 70 void setA(double, ExceptionState&); |
| 71 void setB(double, ExceptionState&); | 71 void setB(double, ExceptionState&); |
| 72 void setC(double, ExceptionState&); | 72 void setC(double, ExceptionState&); |
| 73 void setD(double, ExceptionState&); | 73 void setD(double, ExceptionState&); |
| 74 void setE(double, ExceptionState&); | 74 void setE(double, ExceptionState&); |
| 75 void setF(double, ExceptionState&); | 75 void setF(double, ExceptionState&); |
| 76 | 76 |
| 77 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> translate(double tx, double ty); | 77 RawPtr<SVGMatrixTearOff> translate(double tx, double ty); |
| 78 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> scale(double); | 78 RawPtr<SVGMatrixTearOff> scale(double); |
| 79 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> scaleNonUniform(double sx, double s
y); | 79 RawPtr<SVGMatrixTearOff> scaleNonUniform(double sx, double sy); |
| 80 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> rotate(double); | 80 RawPtr<SVGMatrixTearOff> rotate(double); |
| 81 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> flipX(); | 81 RawPtr<SVGMatrixTearOff> flipX(); |
| 82 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> flipY(); | 82 RawPtr<SVGMatrixTearOff> flipY(); |
| 83 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> skewX(double); | 83 RawPtr<SVGMatrixTearOff> skewX(double); |
| 84 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> skewY(double); | 84 RawPtr<SVGMatrixTearOff> skewY(double); |
| 85 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> multiply(PassRefPtrWillBeRawPtr<SVG
MatrixTearOff>); | 85 RawPtr<SVGMatrixTearOff> multiply(RawPtr<SVGMatrixTearOff>); |
| 86 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> inverse(ExceptionState&); | 86 RawPtr<SVGMatrixTearOff> inverse(ExceptionState&); |
| 87 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> rotateFromVector(double x, double y
, ExceptionState&); | 87 RawPtr<SVGMatrixTearOff> rotateFromVector(double x, double y, ExceptionState
&); |
| 88 | 88 |
| 89 SVGTransformTearOff* contextTransform() { return m_contextTransform; } | 89 SVGTransformTearOff* contextTransform() { return m_contextTransform; } |
| 90 | 90 |
| 91 const AffineTransform& value() const; | 91 const AffineTransform& value() const; |
| 92 | 92 |
| 93 DECLARE_VIRTUAL_TRACE(); | 93 DECLARE_VIRTUAL_TRACE(); |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 explicit SVGMatrixTearOff(const AffineTransform&); | 96 explicit SVGMatrixTearOff(const AffineTransform&); |
| 97 explicit SVGMatrixTearOff(SVGTransformTearOff*); | 97 explicit SVGMatrixTearOff(SVGTransformTearOff*); |
| 98 | 98 |
| 99 AffineTransform* mutableValue(); | 99 AffineTransform* mutableValue(); |
| 100 void commitChange(); | 100 void commitChange(); |
| 101 | 101 |
| 102 AffineTransform m_staticValue; | 102 AffineTransform m_staticValue; |
| 103 | 103 |
| 104 RawPtrWillBeMember<SVGTransformTearOff> m_contextTransform; | 104 Member<SVGTransformTearOff> m_contextTransform; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif // SVGMatrixTearOff_h | 109 #endif // SVGMatrixTearOff_h |
| OLD | NEW |