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

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

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #ifndef PatternAttributes_h 20 #ifndef PatternAttributes_h
21 #define PatternAttributes_h 21 #define PatternAttributes_h
22 22
23 #include "core/svg/SVGLength.h" 23 #include "core/svg/SVGLength.h"
24 #include "core/svg/SVGPreserveAspectRatio.h" 24 #include "core/svg/SVGPreserveAspectRatio.h"
25 #include "platform/heap/Handle.h"
25 #include "platform/transforms/AffineTransform.h" 26 #include "platform/transforms/AffineTransform.h"
26 27
27 namespace blink { 28 namespace blink {
28 29
29 class SVGPatternElement; 30 class SVGPatternElement;
30 31
31 struct PatternAttributes { 32 struct PatternAttributes final {
haraken 2014/11/11 05:22:46 struct => class
sof 2014/11/12 13:45:07 Done.
33 DISALLOW_ALLOCATION();
34 public:
32 PatternAttributes() 35 PatternAttributes()
33 : m_x(SVGLength::create(LengthModeWidth)) 36 : m_x(SVGLength::create(LengthModeWidth))
34 , m_y(SVGLength::create(LengthModeHeight)) 37 , m_y(SVGLength::create(LengthModeHeight))
35 , m_width(SVGLength::create(LengthModeWidth)) 38 , m_width(SVGLength::create(LengthModeWidth))
36 , m_height(SVGLength::create(LengthModeHeight)) 39 , m_height(SVGLength::create(LengthModeHeight))
37 , m_viewBox() 40 , m_viewBox()
38 , m_preserveAspectRatio(SVGPreserveAspectRatio::create()) 41 , m_preserveAspectRatio(SVGPreserveAspectRatio::create())
39 , m_patternUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) 42 , m_patternUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
40 , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) 43 , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
41 , m_patternContentElement(0) 44 , m_patternContentElement(0)
(...skipping 14 matching lines...) Expand all
56 SVGLength* y() const { return m_y.get(); } 59 SVGLength* y() const { return m_y.get(); }
57 SVGLength* width() const { return m_width.get(); } 60 SVGLength* width() const { return m_width.get(); }
58 SVGLength* height() const { return m_height.get(); } 61 SVGLength* height() const { return m_height.get(); }
59 FloatRect viewBox() const { return m_viewBox; } 62 FloatRect viewBox() const { return m_viewBox; }
60 SVGPreserveAspectRatio* preserveAspectRatio() const { return m_preserveAspec tRatio.get(); } 63 SVGPreserveAspectRatio* preserveAspectRatio() const { return m_preserveAspec tRatio.get(); }
61 SVGUnitTypes::SVGUnitType patternUnits() const { return m_patternUnits; } 64 SVGUnitTypes::SVGUnitType patternUnits() const { return m_patternUnits; }
62 SVGUnitTypes::SVGUnitType patternContentUnits() const { return m_patternCont entUnits; } 65 SVGUnitTypes::SVGUnitType patternContentUnits() const { return m_patternCont entUnits; }
63 AffineTransform patternTransform() const { return m_patternTransform; } 66 AffineTransform patternTransform() const { return m_patternTransform; }
64 const SVGPatternElement* patternContentElement() const { return m_patternCon tentElement; } 67 const SVGPatternElement* patternContentElement() const { return m_patternCon tentElement; }
65 68
66 void setX(PassRefPtr<SVGLength> value) 69 void setX(PassRefPtrWillBeRawPtr<SVGLength> value)
67 { 70 {
68 m_x = value; 71 m_x = value;
69 m_xSet = true; 72 m_xSet = true;
70 } 73 }
71 74
72 void setY(PassRefPtr<SVGLength> value) 75 void setY(PassRefPtrWillBeRawPtr<SVGLength> value)
73 { 76 {
74 m_y = value; 77 m_y = value;
75 m_ySet = true; 78 m_ySet = true;
76 } 79 }
77 80
78 void setWidth(PassRefPtr<SVGLength> value) 81 void setWidth(PassRefPtrWillBeRawPtr<SVGLength> value)
79 { 82 {
80 m_width = value; 83 m_width = value;
81 m_widthSet = true; 84 m_widthSet = true;
82 } 85 }
83 86
84 void setHeight(PassRefPtr<SVGLength> value) 87 void setHeight(PassRefPtrWillBeRawPtr<SVGLength> value)
85 { 88 {
86 m_height = value; 89 m_height = value;
87 m_heightSet = true; 90 m_heightSet = true;
88 } 91 }
89 92
90 void setViewBox(const FloatRect& value) 93 void setViewBox(const FloatRect& value)
91 { 94 {
92 m_viewBox = value; 95 m_viewBox = value;
93 m_viewBoxSet = true; 96 m_viewBoxSet = true;
94 } 97 }
95 98
96 void setPreserveAspectRatio(PassRefPtr<SVGPreserveAspectRatio> value) 99 void setPreserveAspectRatio(PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio> v alue)
97 { 100 {
98 m_preserveAspectRatio = value; 101 m_preserveAspectRatio = value;
99 m_preserveAspectRatioSet = true; 102 m_preserveAspectRatioSet = true;
100 } 103 }
101 104
102 void setPatternUnits(SVGUnitTypes::SVGUnitType value) 105 void setPatternUnits(SVGUnitTypes::SVGUnitType value)
103 { 106 {
104 m_patternUnits = value; 107 m_patternUnits = value;
105 m_patternUnitsSet = true; 108 m_patternUnitsSet = true;
106 } 109 }
(...skipping 20 matching lines...) Expand all
127 bool hasY() const { return m_ySet; } 130 bool hasY() const { return m_ySet; }
128 bool hasWidth() const { return m_widthSet; } 131 bool hasWidth() const { return m_widthSet; }
129 bool hasHeight() const { return m_heightSet; } 132 bool hasHeight() const { return m_heightSet; }
130 bool hasViewBox() const { return m_viewBoxSet; } 133 bool hasViewBox() const { return m_viewBoxSet; }
131 bool hasPreserveAspectRatio() const { return m_preserveAspectRatioSet; } 134 bool hasPreserveAspectRatio() const { return m_preserveAspectRatioSet; }
132 bool hasPatternUnits() const { return m_patternUnitsSet; } 135 bool hasPatternUnits() const { return m_patternUnitsSet; }
133 bool hasPatternContentUnits() const { return m_patternContentUnitsSet; } 136 bool hasPatternContentUnits() const { return m_patternContentUnitsSet; }
134 bool hasPatternTransform() const { return m_patternTransformSet; } 137 bool hasPatternTransform() const { return m_patternTransformSet; }
135 bool hasPatternContentElement() const { return m_patternContentElementSet; } 138 bool hasPatternContentElement() const { return m_patternContentElementSet; }
136 139
140 void trace(Visitor* visitor)
141 {
142 visitor->trace(m_x);
143 visitor->trace(m_y);
144 visitor->trace(m_width);
145 visitor->trace(m_height);
146 visitor->trace(m_preserveAspectRatio);
147 }
148
137 private: 149 private:
138 // Properties 150 // Properties
139 RefPtr<SVGLength> m_x; 151 RefPtrWillBeMember<SVGLength> m_x;
140 RefPtr<SVGLength> m_y; 152 RefPtrWillBeMember<SVGLength> m_y;
141 RefPtr<SVGLength> m_width; 153 RefPtrWillBeMember<SVGLength> m_width;
142 RefPtr<SVGLength> m_height; 154 RefPtrWillBeMember<SVGLength> m_height;
143 FloatRect m_viewBox; 155 FloatRect m_viewBox;
144 RefPtr<SVGPreserveAspectRatio> m_preserveAspectRatio; 156 RefPtrWillBeMember<SVGPreserveAspectRatio> m_preserveAspectRatio;
145 SVGUnitTypes::SVGUnitType m_patternUnits; 157 SVGUnitTypes::SVGUnitType m_patternUnits;
146 SVGUnitTypes::SVGUnitType m_patternContentUnits; 158 SVGUnitTypes::SVGUnitType m_patternContentUnits;
147 AffineTransform m_patternTransform; 159 AffineTransform m_patternTransform;
148 const SVGPatternElement* m_patternContentElement; 160 const SVGPatternElement* m_patternContentElement;
haraken 2014/11/11 05:22:46 This should be a Member.
sof 2014/11/12 13:45:07 Done.
149 161
150 // Property states 162 // Property states
151 bool m_xSet : 1; 163 bool m_xSet : 1;
152 bool m_ySet : 1; 164 bool m_ySet : 1;
153 bool m_widthSet : 1; 165 bool m_widthSet : 1;
154 bool m_heightSet : 1; 166 bool m_heightSet : 1;
155 bool m_viewBoxSet : 1; 167 bool m_viewBoxSet : 1;
156 bool m_preserveAspectRatioSet : 1; 168 bool m_preserveAspectRatioSet : 1;
157 bool m_patternUnitsSet : 1; 169 bool m_patternUnitsSet : 1;
158 bool m_patternContentUnitsSet : 1; 170 bool m_patternContentUnitsSet : 1;
159 bool m_patternTransformSet : 1; 171 bool m_patternTransformSet : 1;
160 bool m_patternContentElementSet : 1; 172 bool m_patternContentElementSet : 1;
161 }; 173 };
162 174
163 } // namespace blink 175 } // namespace blink
164 176
165 #endif 177 #endif // PatternAttributes_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698