Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: Source/core/svg/SVGTransform.h

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased upto r185213 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGTextPositioningElement.cpp ('k') | Source/core/svg/SVGTransform.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class SVGTransform : public SVGPropertyBase { 44 class SVGTransform : public SVGPropertyBase {
45 public: 45 public:
46 typedef SVGTransformTearOff TearOffType; 46 typedef SVGTransformTearOff TearOffType;
47 47
48 enum ConstructionMode { 48 enum ConstructionMode {
49 ConstructIdentityTransform, 49 ConstructIdentityTransform,
50 ConstructZeroTransform 50 ConstructZeroTransform
51 }; 51 };
52 52
53 static PassRefPtr<SVGTransform> create() 53 static PassRefPtrWillBeRawPtr<SVGTransform> create()
54 { 54 {
55 return adoptRef(new SVGTransform()); 55 return adoptRefWillBeNoop(new SVGTransform());
56 } 56 }
57 57
58 static PassRefPtr<SVGTransform> create(SVGTransformType type, ConstructionMo de mode = ConstructIdentityTransform) 58 static PassRefPtrWillBeRawPtr<SVGTransform> create(SVGTransformType type, Co nstructionMode mode = ConstructIdentityTransform)
59 { 59 {
60 return adoptRef(new SVGTransform(type, mode)); 60 return adoptRefWillBeNoop(new SVGTransform(type, mode));
61 } 61 }
62 62
63 static PassRefPtr<SVGTransform> create(const AffineTransform& affineTransfor m) 63 static PassRefPtrWillBeRawPtr<SVGTransform> create(const AffineTransform& af fineTransform)
64 { 64 {
65 return adoptRef(new SVGTransform(affineTransform)); 65 return adoptRefWillBeNoop(new SVGTransform(affineTransform));
66 } 66 }
67 67
68 virtual ~SVGTransform(); 68 virtual ~SVGTransform();
69 69
70 PassRefPtr<SVGTransform> clone() const; 70 PassRefPtrWillBeRawPtr<SVGTransform> clone() const;
71 virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String&) const o verride; 71 virtual PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const Stri ng&) const override;
72 72
73 SVGTransformType transformType() const { return m_transformType; } 73 SVGTransformType transformType() const { return m_transformType; }
74 74
75 const AffineTransform& matrix() const { return m_matrix; } 75 const AffineTransform& matrix() const { return m_matrix; }
76 76
77 // |onMatrixChange| must be called after modifications via |mutableMatrix|. 77 // |onMatrixChange| must be called after modifications via |mutableMatrix|.
78 AffineTransform* mutableMatrix() { return &m_matrix; } 78 AffineTransform* mutableMatrix() { return &m_matrix; }
79 void onMatrixChange(); 79 void onMatrixChange();
80 80
81 float angle() const { return m_angle; } 81 float angle() const { return m_angle; }
82 FloatPoint rotationCenter() const { return m_center; } 82 FloatPoint rotationCenter() const { return m_center; }
83 83
84 void setMatrix(const AffineTransform&); 84 void setMatrix(const AffineTransform&);
85 void setTranslate(float tx, float ty); 85 void setTranslate(float tx, float ty);
86 void setScale(float sx, float sy); 86 void setScale(float sx, float sy);
87 void setRotate(float angle, float cx, float cy); 87 void setRotate(float angle, float cx, float cy);
88 void setSkewX(float angle); 88 void setSkewX(float angle);
89 void setSkewY(float angle); 89 void setSkewY(float angle);
90 90
91 // Internal use only (animation system) 91 // Internal use only (animation system)
92 FloatPoint translate() const; 92 FloatPoint translate() const;
93 FloatSize scale() const; 93 FloatSize scale() const;
94 94
95 virtual String valueAsString() const override; 95 virtual String valueAsString() const override;
96 96
97 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) overr ide; 97 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) overr ide;
98 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBa se> to, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextE lement) override; 98 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWi llBeRawPtr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndO fDurationValue, SVGElement* contextElement) override;
99 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement* contextElement) override; 99 virtual float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGElement* contextElement) override;
100 100
101 static AnimatedPropertyType classType() { return AnimatedTransform; } 101 static AnimatedPropertyType classType() { return AnimatedTransform; }
102 102
103 private: 103 private:
104 SVGTransform(); 104 SVGTransform();
105 SVGTransform(SVGTransformType, ConstructionMode); 105 SVGTransform(SVGTransformType, ConstructionMode);
106 explicit SVGTransform(const AffineTransform&); 106 explicit SVGTransform(const AffineTransform&);
107 SVGTransform(SVGTransformType, float, const FloatPoint&, const AffineTransfo rm&); 107 SVGTransform(SVGTransformType, float, const FloatPoint&, const AffineTransfo rm&);
108 108
109 SVGTransformType m_transformType; 109 SVGTransformType m_transformType;
110 float m_angle; 110 float m_angle;
111 FloatPoint m_center; 111 FloatPoint m_center;
112 AffineTransform m_matrix; 112 AffineTransform m_matrix;
113 }; 113 };
114 114
115 } // namespace blink 115 } // namespace blink
116 116
117 #endif 117 #endif // SVGTransform_h
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTextPositioningElement.cpp ('k') | Source/core/svg/SVGTransform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698