OLD | NEW |
| (Empty) |
1 /* | |
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | |
3 2004, 2005 Rob Buis <buis@kde.org> | |
4 Copyright (C) 2005, 2006 Apple Computer, Inc. | |
5 Copyright (C) Research In Motion Limited 2010. All rights reserved. | |
6 | |
7 This library is free software; you can redistribute it and/or | |
8 modify it under the terms of the GNU Library General Public | |
9 License as published by the Free Software Foundation; either | |
10 version 2 of the License, or (at your option) any later version. | |
11 | |
12 This library is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 Library General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU Library General Public License | |
18 along with this library; see the file COPYING.LIB. If not, write to | |
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
20 Boston, MA 02110-1301, USA. | |
21 */ | |
22 | |
23 #ifndef SVGLayoutStyle_h | |
24 #define SVGLayoutStyle_h | |
25 | |
26 #include "core/layout/style/DataRef.h" | |
27 #include "core/layout/style/LayoutStyleConstants.h" | |
28 #include "core/layout/style/SVGLayoutStyleDefs.h" | |
29 #include "core/layout/style/StyleDifference.h" | |
30 #include "platform/Length.h" | |
31 #include "platform/graphics/GraphicsTypes.h" | |
32 #include "platform/graphics/Path.h" | |
33 | |
34 namespace blink { | |
35 | |
36 class SVGLayoutStyle : public RefCounted<SVGLayoutStyle> { | |
37 public: | |
38 static PassRefPtr<SVGLayoutStyle> create() { return adoptRef(new SVGLayoutSt
yle); } | |
39 PassRefPtr<SVGLayoutStyle> copy() const { return adoptRef(new SVGLayoutStyle
(*this));} | |
40 ~SVGLayoutStyle(); | |
41 | |
42 bool inheritedNotEqual(const SVGLayoutStyle*) const; | |
43 void inheritFrom(const SVGLayoutStyle*); | |
44 void copyNonInheritedFromCached(const SVGLayoutStyle*); | |
45 | |
46 StyleDifference diff(const SVGLayoutStyle*) const; | |
47 | |
48 bool operator==(const SVGLayoutStyle&) const; | |
49 bool operator!=(const SVGLayoutStyle& o) const { return !(*this == o); } | |
50 | |
51 // Initial values for all the properties | |
52 static EAlignmentBaseline initialAlignmentBaseline() { return AB_AUTO; } | |
53 static EDominantBaseline initialDominantBaseline() { return DB_AUTO; } | |
54 static EBaselineShift initialBaselineShift() { return BS_LENGTH; } | |
55 static Length initialBaselineShiftValue() { return Length(Fixed); } | |
56 static EVectorEffect initialVectorEffect() { return VE_NONE; } | |
57 static EBufferedRendering initialBufferedRendering() { return BR_AUTO; } | |
58 static LineCap initialCapStyle() { return ButtCap; } | |
59 static WindRule initialClipRule() { return RULE_NONZERO; } | |
60 static EColorInterpolation initialColorInterpolation() { return CI_SRGB; } | |
61 static EColorInterpolation initialColorInterpolationFilters() { return CI_LI
NEARRGB; } | |
62 static EColorRendering initialColorRendering() { return CR_AUTO; } | |
63 static WindRule initialFillRule() { return RULE_NONZERO; } | |
64 static LineJoin initialJoinStyle() { return MiterJoin; } | |
65 static EShapeRendering initialShapeRendering() { return SR_AUTO; } | |
66 static ETextAnchor initialTextAnchor() { return TA_START; } | |
67 static SVGWritingMode initialWritingMode() { return WM_LRTB; } | |
68 static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DE
G; } | |
69 static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO;
} | |
70 static float initialFillOpacity() { return 1; } | |
71 static SVGPaintType initialFillPaintType() { return SVG_PAINTTYPE_RGBCOLOR;
} | |
72 static Color initialFillPaintColor() { return Color::black; } | |
73 static String initialFillPaintUri() { return String(); } | |
74 static float initialStrokeOpacity() { return 1; } | |
75 static SVGPaintType initialStrokePaintType() { return SVG_PAINTTYPE_NONE; } | |
76 static Color initialStrokePaintColor() { return Color(); } | |
77 static String initialStrokePaintUri() { return String(); } | |
78 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); | |
79 static Length initialStrokeDashOffset() { return Length(Fixed); } | |
80 static float initialStrokeMiterLimit() { return 4; } | |
81 static UnzoomedLength initialStrokeWidth() { return UnzoomedLength(Length(1,
Fixed)); } | |
82 static float initialStopOpacity() { return 1; } | |
83 static Color initialStopColor() { return Color(0, 0, 0); } | |
84 static float initialFloodOpacity() { return 1; } | |
85 static Color initialFloodColor() { return Color(0, 0, 0); } | |
86 static Color initialLightingColor() { return Color(255, 255, 255); } | |
87 static const AtomicString& initialClipperResource() { return nullAtom; } | |
88 static const AtomicString& initialFilterResource() { return nullAtom; } | |
89 static const AtomicString& initialMaskerResource() { return nullAtom; } | |
90 static const AtomicString& initialMarkerStartResource() { return nullAtom; } | |
91 static const AtomicString& initialMarkerMidResource() { return nullAtom; } | |
92 static const AtomicString& initialMarkerEndResource() { return nullAtom; } | |
93 static EMaskType initialMaskType() { return MT_LUMINANCE; } | |
94 static EPaintOrder initialPaintOrder() { return PO_NORMAL; } | |
95 static Length initialCx() { return Length(Fixed); } | |
96 static Length initialCy() { return Length(Fixed); } | |
97 static Length initialX() { return Length(Fixed); } | |
98 static Length initialY() { return Length(Fixed); } | |
99 static Length initialR() { return Length(Fixed); } | |
100 static Length initialRx() { return Length(Fixed); } | |
101 static Length initialRy() { return Length(Fixed); } | |
102 | |
103 // SVG CSS Property setters | |
104 void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f
._alignmentBaseline = val; } | |
105 void setDominantBaseline(EDominantBaseline val) { svg_noninherited_flags.f._
dominantBaseline = val; } | |
106 void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f._baseli
neShift = val; } | |
107 void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f._vectorEf
fect = val; } | |
108 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f
.bufferedRendering = val; } | |
109 void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; } | |
110 void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; } | |
111 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._c
olorInterpolation = val; } | |
112 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f
lags._colorInterpolationFilters = val; } | |
113 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend
ering = val; } | |
114 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; } | |
115 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } | |
116 void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRend
ering = val; } | |
117 void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val;
} | |
118 void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode =
val; } | |
119 void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_fl
ags._glyphOrientationHorizontal = val; } | |
120 void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flag
s._glyphOrientationVertical = val; } | |
121 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; } | |
122 void setPaintOrder(EPaintOrder val) { svg_inherited_flags._paintOrder = (int
)val; } | |
123 void setCx(const Length& obj) | |
124 { | |
125 if (!(layout->cx == obj)) | |
126 layout.access()->cx = obj; | |
127 } | |
128 void setCy(const Length& obj) | |
129 { | |
130 if (!(layout->cy == obj)) | |
131 layout.access()->cy = obj; | |
132 } | |
133 void setX(const Length& obj) | |
134 { | |
135 if (!(layout->x == obj)) | |
136 layout.access()->x = obj; | |
137 } | |
138 void setY(const Length& obj) | |
139 { | |
140 if (!(layout->y == obj)) | |
141 layout.access()->y = obj; | |
142 } | |
143 void setR(const Length& obj) | |
144 { | |
145 if (!(layout->r == obj)) | |
146 layout.access()->r = obj; | |
147 } | |
148 void setRx(const Length& obj) | |
149 { | |
150 if (!(layout->rx == obj)) | |
151 layout.access()->rx = obj; | |
152 } | |
153 void setRy(const Length& obj) | |
154 { | |
155 if (!(layout->ry == obj)) | |
156 layout.access()->ry = obj; | |
157 } | |
158 void setFillOpacity(float obj) | |
159 { | |
160 if (!(fill->opacity == obj)) | |
161 fill.access()->opacity = obj; | |
162 } | |
163 | |
164 void setFillPaint(SVGPaintType type, const Color& color, const String& uri,
bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false) | |
165 { | |
166 if (applyToRegularStyle) { | |
167 if (!(fill->paintType == type)) | |
168 fill.access()->paintType = type; | |
169 if (!(fill->paintColor == color)) | |
170 fill.access()->paintColor = color; | |
171 if (!(fill->paintUri == uri)) | |
172 fill.access()->paintUri = uri; | |
173 } | |
174 if (applyToVisitedLinkStyle) { | |
175 if (!(fill->visitedLinkPaintType == type)) | |
176 fill.access()->visitedLinkPaintType = type; | |
177 if (!(fill->visitedLinkPaintColor == color)) | |
178 fill.access()->visitedLinkPaintColor = color; | |
179 if (!(fill->visitedLinkPaintUri == uri)) | |
180 fill.access()->visitedLinkPaintUri = uri; | |
181 } | |
182 } | |
183 | |
184 void setStrokeOpacity(float obj) | |
185 { | |
186 if (!(stroke->opacity == obj)) | |
187 stroke.access()->opacity = obj; | |
188 } | |
189 | |
190 void setStrokePaint(SVGPaintType type, const Color& color, const String& uri
, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false) | |
191 { | |
192 if (applyToRegularStyle) { | |
193 if (!(stroke->paintType == type)) | |
194 stroke.access()->paintType = type; | |
195 if (!(stroke->paintColor == color)) | |
196 stroke.access()->paintColor = color; | |
197 if (!(stroke->paintUri == uri)) | |
198 stroke.access()->paintUri = uri; | |
199 } | |
200 if (applyToVisitedLinkStyle) { | |
201 if (!(stroke->visitedLinkPaintType == type)) | |
202 stroke.access()->visitedLinkPaintType = type; | |
203 if (!(stroke->visitedLinkPaintColor == color)) | |
204 stroke.access()->visitedLinkPaintColor = color; | |
205 if (!(stroke->visitedLinkPaintUri == uri)) | |
206 stroke.access()->visitedLinkPaintUri = uri; | |
207 } | |
208 } | |
209 | |
210 void setStrokeDashArray(PassRefPtr<SVGDashArray> dashArray) | |
211 { | |
212 if (*stroke->dashArray != *dashArray) | |
213 stroke.access()->dashArray = dashArray; | |
214 } | |
215 | |
216 void setStrokeMiterLimit(float obj) | |
217 { | |
218 if (!(stroke->miterLimit == obj)) | |
219 stroke.access()->miterLimit = obj; | |
220 } | |
221 | |
222 void setStrokeWidth(const UnzoomedLength& strokeWidth) | |
223 { | |
224 if (!(stroke->width == strokeWidth)) | |
225 stroke.access()->width = strokeWidth; | |
226 } | |
227 | |
228 void setStrokeDashOffset(const Length& dashOffset) | |
229 { | |
230 if (!(stroke->dashOffset == dashOffset)) | |
231 stroke.access()->dashOffset = dashOffset; | |
232 } | |
233 | |
234 void setStopOpacity(float obj) | |
235 { | |
236 if (!(stops->opacity == obj)) | |
237 stops.access()->opacity = obj; | |
238 } | |
239 | |
240 void setStopColor(const Color& obj) | |
241 { | |
242 if (!(stops->color == obj)) | |
243 stops.access()->color = obj; | |
244 } | |
245 | |
246 void setFloodOpacity(float obj) | |
247 { | |
248 if (!(misc->floodOpacity == obj)) | |
249 misc.access()->floodOpacity = obj; | |
250 } | |
251 | |
252 void setFloodColor(const Color& obj) | |
253 { | |
254 if (!(misc->floodColor == obj)) | |
255 misc.access()->floodColor = obj; | |
256 } | |
257 | |
258 void setLightingColor(const Color& obj) | |
259 { | |
260 if (!(misc->lightingColor == obj)) | |
261 misc.access()->lightingColor = obj; | |
262 } | |
263 | |
264 void setBaselineShiftValue(const Length& baselineShiftValue) | |
265 { | |
266 if (!(misc->baselineShiftValue == baselineShiftValue)) | |
267 misc.access()->baselineShiftValue = baselineShiftValue; | |
268 } | |
269 | |
270 // Setters for non-inherited resources | |
271 void setClipperResource(const AtomicString& obj) | |
272 { | |
273 if (!(resources->clipper == obj)) | |
274 resources.access()->clipper = obj; | |
275 } | |
276 | |
277 void setFilterResource(const AtomicString& obj) | |
278 { | |
279 if (!(resources->filter == obj)) | |
280 resources.access()->filter = obj; | |
281 } | |
282 | |
283 void setMaskerResource(const AtomicString& obj) | |
284 { | |
285 if (!(resources->masker == obj)) | |
286 resources.access()->masker = obj; | |
287 } | |
288 | |
289 // Setters for inherited resources | |
290 void setMarkerStartResource(const AtomicString& obj) | |
291 { | |
292 if (!(inheritedResources->markerStart == obj)) | |
293 inheritedResources.access()->markerStart = obj; | |
294 } | |
295 | |
296 void setMarkerMidResource(const AtomicString& obj) | |
297 { | |
298 if (!(inheritedResources->markerMid == obj)) | |
299 inheritedResources.access()->markerMid = obj; | |
300 } | |
301 | |
302 void setMarkerEndResource(const AtomicString& obj) | |
303 { | |
304 if (!(inheritedResources->markerEnd == obj)) | |
305 inheritedResources.access()->markerEnd = obj; | |
306 } | |
307 | |
308 // Read accessors for all the properties | |
309 EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) s
vg_noninherited_flags.f._alignmentBaseline; } | |
310 EDominantBaseline dominantBaseline() const { return (EDominantBaseline) svg_
noninherited_flags.f._dominantBaseline; } | |
311 EBaselineShift baselineShift() const { return (EBaselineShift) svg_noninheri
ted_flags.f._baselineShift; } | |
312 EVectorEffect vectorEffect() const { return (EVectorEffect) svg_noninherited
_flags.f._vectorEffect; } | |
313 EBufferedRendering bufferedRendering() const { return (EBufferedRendering) s
vg_noninherited_flags.f.bufferedRendering; } | |
314 LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; } | |
315 WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule;
} | |
316 EColorInterpolation colorInterpolation() const { return (EColorInterpolation
) svg_inherited_flags._colorInterpolation; } | |
317 EColorInterpolation colorInterpolationFilters() const { return (EColorInterp
olation) svg_inherited_flags._colorInterpolationFilters; } | |
318 EColorRendering colorRendering() const { return (EColorRendering) svg_inheri
ted_flags._colorRendering; } | |
319 WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule;
} | |
320 LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyl
e; } | |
321 EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inheri
ted_flags._shapeRendering; } | |
322 ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._t
extAnchor; } | |
323 SVGWritingMode writingMode() const { return (SVGWritingMode) svg_inherited_f
lags._writingMode; } | |
324 EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrienta
tion) svg_inherited_flags._glyphOrientationHorizontal; } | |
325 EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientati
on) svg_inherited_flags._glyphOrientationVertical; } | |
326 float fillOpacity() const { return fill->opacity; } | |
327 const SVGPaintType& fillPaintType() const { return fill->paintType; } | |
328 const Color& fillPaintColor() const { return fill->paintColor; } | |
329 const String& fillPaintUri() const { return fill->paintUri; } | |
330 float strokeOpacity() const { return stroke->opacity; } | |
331 const SVGPaintType& strokePaintType() const { return stroke->paintType; } | |
332 const Color& strokePaintColor() const { return stroke->paintColor; } | |
333 const String& strokePaintUri() const { return stroke->paintUri; } | |
334 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); } | |
335 float strokeMiterLimit() const { return stroke->miterLimit; } | |
336 const UnzoomedLength& strokeWidth() const { return stroke->width; } | |
337 const Length& strokeDashOffset() const { return stroke->dashOffset; } | |
338 float stopOpacity() const { return stops->opacity; } | |
339 const Color& stopColor() const { return stops->color; } | |
340 float floodOpacity() const { return misc->floodOpacity; } | |
341 const Color& floodColor() const { return misc->floodColor; } | |
342 const Color& lightingColor() const { return misc->lightingColor; } | |
343 const Length& baselineShiftValue() const { return misc->baselineShiftValue;
} | |
344 const Length& cx() const { return layout->cx; } | |
345 const Length& cy() const { return layout->cy; } | |
346 const Length& x() const { return layout->x; } | |
347 const Length& y() const { return layout->y; } | |
348 const Length& r() const { return layout->r; } | |
349 const Length& rx() const { return layout->rx; } | |
350 const Length& ry() const { return layout->ry; } | |
351 const AtomicString& clipperResource() const { return resources->clipper; } | |
352 const AtomicString& filterResource() const { return resources->filter; } | |
353 const AtomicString& maskerResource() const { return resources->masker; } | |
354 const AtomicString& markerStartResource() const { return inheritedResources-
>markerStart; } | |
355 const AtomicString& markerMidResource() const { return inheritedResources->m
arkerMid; } | |
356 const AtomicString& markerEndResource() const { return inheritedResources->m
arkerEnd; } | |
357 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas
kType; } | |
358 EPaintOrder paintOrder() const { return (EPaintOrder) svg_inherited_flags._p
aintOrder; } | |
359 EPaintOrderType paintOrderType(unsigned index) const; | |
360 | |
361 const SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedL
inkPaintType; } | |
362 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai
ntColor; } | |
363 const String& visitedLinkFillPaintUri() const { return fill->visitedLinkPain
tUri; } | |
364 const SVGPaintType& visitedLinkStrokePaintType() const { return stroke->visi
tedLinkPaintType; } | |
365 const Color& visitedLinkStrokePaintColor() const { return stroke->visitedLin
kPaintColor; } | |
366 const String& visitedLinkStrokePaintUri() const { return stroke->visitedLink
PaintUri; } | |
367 | |
368 // convenience | |
369 bool hasClipper() const { return !clipperResource().isEmpty(); } | |
370 bool hasMasker() const { return !maskerResource().isEmpty(); } | |
371 bool hasFilter() const { return !filterResource().isEmpty(); } | |
372 bool hasMarkers() const { return !markerStartResource().isEmpty() || !marker
MidResource().isEmpty() || !markerEndResource().isEmpty(); } | |
373 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; } | |
374 bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(
); } | |
375 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; } | |
376 bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writ
ingMode() == WM_TB; } | |
377 | |
378 protected: | |
379 // inherit | |
380 struct InheritedFlags { | |
381 bool operator==(const InheritedFlags& other) const | |
382 { | |
383 return (_colorRendering == other._colorRendering) | |
384 && (_shapeRendering == other._shapeRendering) | |
385 && (_clipRule == other._clipRule) | |
386 && (_fillRule == other._fillRule) | |
387 && (_capStyle == other._capStyle) | |
388 && (_joinStyle == other._joinStyle) | |
389 && (_textAnchor == other._textAnchor) | |
390 && (_colorInterpolation == other._colorInterpolation) | |
391 && (_colorInterpolationFilters == other._colorInterpolationFilte
rs) | |
392 && (_writingMode == other._writingMode) | |
393 && (_glyphOrientationHorizontal == other._glyphOrientationHorizo
ntal) | |
394 && (_glyphOrientationVertical == other._glyphOrientationVertical
) | |
395 && (_paintOrder == other._paintOrder); | |
396 } | |
397 | |
398 bool operator!=(const InheritedFlags& other) const | |
399 { | |
400 return !(*this == other); | |
401 } | |
402 | |
403 unsigned _colorRendering : 2; // EColorRendering | |
404 unsigned _shapeRendering : 2; // EShapeRendering | |
405 unsigned _clipRule : 1; // WindRule | |
406 unsigned _fillRule : 1; // WindRule | |
407 unsigned _capStyle : 2; // LineCap | |
408 unsigned _joinStyle : 2; // LineJoin | |
409 unsigned _textAnchor : 2; // ETextAnchor | |
410 unsigned _colorInterpolation : 2; // EColorInterpolation | |
411 unsigned _colorInterpolationFilters : 2; // EColorInterpolation | |
412 unsigned _writingMode : 3; // SVGWritingMode | |
413 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation | |
414 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation | |
415 unsigned _paintOrder : 6; // EPaintOrder | |
416 } svg_inherited_flags; | |
417 | |
418 // don't inherit | |
419 struct NonInheritedFlags { | |
420 // 32 bit non-inherited, don't add to the struct, or the operator will b
reak. | |
421 bool operator==(const NonInheritedFlags &other) const { return _niflags
== other._niflags; } | |
422 bool operator!=(const NonInheritedFlags &other) const { return _niflags
!= other._niflags; } | |
423 | |
424 union { | |
425 struct { | |
426 unsigned _alignmentBaseline : 4; // EAlignmentBaseline | |
427 unsigned _dominantBaseline : 4; // EDominantBaseline | |
428 unsigned _baselineShift : 2; // EBaselineShift | |
429 unsigned _vectorEffect: 1; // EVectorEffect | |
430 unsigned bufferedRendering: 2; // EBufferedRendering | |
431 unsigned maskType: 1; // EMaskType | |
432 // 18 bits unused | |
433 } f; | |
434 uint32_t _niflags; | |
435 }; | |
436 } svg_noninherited_flags; | |
437 | |
438 // inherited attributes | |
439 DataRef<StyleFillData> fill; | |
440 DataRef<StyleStrokeData> stroke; | |
441 DataRef<StyleInheritedResourceData> inheritedResources; | |
442 | |
443 // non-inherited attributes | |
444 DataRef<StyleStopData> stops; | |
445 DataRef<StyleMiscData> misc; | |
446 DataRef<StyleLayoutData> layout; | |
447 DataRef<StyleResourceData> resources; | |
448 | |
449 private: | |
450 enum CreateInitialType { CreateInitial }; | |
451 | |
452 SVGLayoutStyle(); | |
453 SVGLayoutStyle(const SVGLayoutStyle&); | |
454 SVGLayoutStyle(CreateInitialType); // Used to create the initial style singl
eton. | |
455 | |
456 bool diffNeedsLayoutAndPaintInvalidation(const SVGLayoutStyle* other) const; | |
457 bool diffNeedsPaintInvalidation(const SVGLayoutStyle* other) const; | |
458 | |
459 void setBitDefaults() | |
460 { | |
461 svg_inherited_flags._clipRule = initialClipRule(); | |
462 svg_inherited_flags._colorRendering = initialColorRendering(); | |
463 svg_inherited_flags._fillRule = initialFillRule(); | |
464 svg_inherited_flags._shapeRendering = initialShapeRendering(); | |
465 svg_inherited_flags._textAnchor = initialTextAnchor(); | |
466 svg_inherited_flags._capStyle = initialCapStyle(); | |
467 svg_inherited_flags._joinStyle = initialJoinStyle(); | |
468 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); | |
469 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati
onFilters(); | |
470 svg_inherited_flags._writingMode = initialWritingMode(); | |
471 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientatio
nHorizontal(); | |
472 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationV
ertical(); | |
473 svg_inherited_flags._paintOrder = initialPaintOrder(); | |
474 | |
475 svg_noninherited_flags._niflags = 0; | |
476 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline()
; | |
477 svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline(); | |
478 svg_noninherited_flags.f._baselineShift = initialBaselineShift(); | |
479 svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); | |
480 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); | |
481 svg_noninherited_flags.f.maskType = initialMaskType(); | |
482 } | |
483 }; | |
484 | |
485 } // namespace blink | |
486 | |
487 #endif // SVGLayoutStyle_h | |
OLD | NEW |