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

Side by Side Diff: Source/core/rendering/style/SVGRenderStyle.h

Issue 14907011: Support 'paint-order' from SVG2. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 months 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>
4 Copyright (C) 2005, 2006 Apple Computer, Inc. 4 Copyright (C) 2005, 2006 Apple Computer, Inc.
5 Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 static Color initialFloodColor() { return Color(0, 0, 0); } 88 static Color initialFloodColor() { return Color(0, 0, 0); }
89 static Color initialLightingColor() { return Color(255, 255, 255); } 89 static Color initialLightingColor() { return Color(255, 255, 255); }
90 static ShadowData* initialShadow() { return 0; } 90 static ShadowData* initialShadow() { return 0; }
91 static String initialClipperResource() { return String(); } 91 static String initialClipperResource() { return String(); }
92 static String initialFilterResource() { return String(); } 92 static String initialFilterResource() { return String(); }
93 static String initialMaskerResource() { return String(); } 93 static String initialMaskerResource() { return String(); }
94 static String initialMarkerStartResource() { return String(); } 94 static String initialMarkerStartResource() { return String(); }
95 static String initialMarkerMidResource() { return String(); } 95 static String initialMarkerMidResource() { return String(); }
96 static String initialMarkerEndResource() { return String(); } 96 static String initialMarkerEndResource() { return String(); }
97 static EMaskType initialMaskType() { return MT_LUMINANCE; } 97 static EMaskType initialMaskType() { return MT_LUMINANCE; }
98 static EPaintOrder initialPaintOrder() { return PO_NORMAL; }
98 99
99 static SVGLength initialBaselineShiftValue() 100 static SVGLength initialBaselineShiftValue()
100 { 101 {
101 SVGLength length; 102 SVGLength length;
102 length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION); 103 length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
103 return length; 104 return length;
104 } 105 }
105 106
106 static SVGLength initialKerning() 107 static SVGLength initialKerning()
107 { 108 {
(...skipping 28 matching lines...) Expand all
136 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f lags._colorInterpolationFilters = val; } 137 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f lags._colorInterpolationFilters = val; }
137 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend ering = val; } 138 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend ering = val; }
138 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; } 139 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; }
139 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } 140 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; }
140 void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRend ering = val; } 141 void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRend ering = val; }
141 void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; } 142 void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; }
142 void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode = val; } 143 void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode = val; }
143 void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_fl ags._glyphOrientationHorizontal = val; } 144 void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_fl ags._glyphOrientationHorizontal = val; }
144 void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flag s._glyphOrientationVertical = val; } 145 void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flag s._glyphOrientationVertical = val; }
145 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; } 146 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; }
147 void setPaintOrder(EPaintOrder val) { svg_inherited_flags._paintOrder = val; }
146 148
147 void setFillOpacity(float obj) 149 void setFillOpacity(float obj)
148 { 150 {
149 if (!(fill->opacity == obj)) 151 if (!(fill->opacity == obj))
150 fill.access()->opacity = obj; 152 fill.access()->opacity = obj;
151 } 153 }
152 154
153 void setFillPaint(SVGPaint::SVGPaintType type, const Color& color, const Str ing& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false) 155 void setFillPaint(SVGPaint::SVGPaintType type, const Color& color, const Str ing& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false)
154 { 156 {
155 if (applyToRegularStyle) { 157 if (applyToRegularStyle) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 const Color& lightingColor() const { return misc->lightingColor; } 342 const Color& lightingColor() const { return misc->lightingColor; }
341 SVGLength baselineShiftValue() const { return misc->baselineShiftValue; } 343 SVGLength baselineShiftValue() const { return misc->baselineShiftValue; }
342 ShadowData* shadow() const { return shadowSVG->shadow.get(); } 344 ShadowData* shadow() const { return shadowSVG->shadow.get(); }
343 String clipperResource() const { return resources->clipper; } 345 String clipperResource() const { return resources->clipper; }
344 String filterResource() const { return resources->filter; } 346 String filterResource() const { return resources->filter; }
345 String maskerResource() const { return resources->masker; } 347 String maskerResource() const { return resources->masker; }
346 String markerStartResource() const { return inheritedResources->markerStart; } 348 String markerStartResource() const { return inheritedResources->markerStart; }
347 String markerMidResource() const { return inheritedResources->markerMid; } 349 String markerMidResource() const { return inheritedResources->markerMid; }
348 String markerEndResource() const { return inheritedResources->markerEnd; } 350 String markerEndResource() const { return inheritedResources->markerEnd; }
349 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas kType; } 351 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas kType; }
352 EPaintOrder paintOrder() const { return (EPaintOrder) svg_inherited_flags._p aintOrder; }
353 EPaintOrder paintOrder(int index) const;
350 354
351 const SVGPaint::SVGPaintType& visitedLinkFillPaintType() const { return fill ->visitedLinkPaintType; } 355 const SVGPaint::SVGPaintType& visitedLinkFillPaintType() const { return fill ->visitedLinkPaintType; }
352 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai ntColor; } 356 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai ntColor; }
353 const String& visitedLinkFillPaintUri() const { return fill->visitedLinkPain tUri; } 357 const String& visitedLinkFillPaintUri() const { return fill->visitedLinkPain tUri; }
354 const SVGPaint::SVGPaintType& visitedLinkStrokePaintType() const { return st roke->visitedLinkPaintType; } 358 const SVGPaint::SVGPaintType& visitedLinkStrokePaintType() const { return st roke->visitedLinkPaintType; }
355 const Color& visitedLinkStrokePaintColor() const { return stroke->visitedLin kPaintColor; } 359 const Color& visitedLinkStrokePaintColor() const { return stroke->visitedLin kPaintColor; }
356 const String& visitedLinkStrokePaintUri() const { return stroke->visitedLink PaintUri; } 360 const String& visitedLinkStrokePaintUri() const { return stroke->visitedLink PaintUri; }
357 361
358 // convenience 362 // convenience
359 bool hasClipper() const { return !clipperResource().isEmpty(); } 363 bool hasClipper() const { return !clipperResource().isEmpty(); }
(...skipping 14 matching lines...) Expand all
374 && (_shapeRendering == other._shapeRendering) 378 && (_shapeRendering == other._shapeRendering)
375 && (_clipRule == other._clipRule) 379 && (_clipRule == other._clipRule)
376 && (_fillRule == other._fillRule) 380 && (_fillRule == other._fillRule)
377 && (_capStyle == other._capStyle) 381 && (_capStyle == other._capStyle)
378 && (_joinStyle == other._joinStyle) 382 && (_joinStyle == other._joinStyle)
379 && (_textAnchor == other._textAnchor) 383 && (_textAnchor == other._textAnchor)
380 && (_colorInterpolation == other._colorInterpolation) 384 && (_colorInterpolation == other._colorInterpolation)
381 && (_colorInterpolationFilters == other._colorInterpolationFilte rs) 385 && (_colorInterpolationFilters == other._colorInterpolationFilte rs)
382 && (_writingMode == other._writingMode) 386 && (_writingMode == other._writingMode)
383 && (_glyphOrientationHorizontal == other._glyphOrientationHorizo ntal) 387 && (_glyphOrientationHorizontal == other._glyphOrientationHorizo ntal)
384 && (_glyphOrientationVertical == other._glyphOrientationVertical ); 388 && (_glyphOrientationVertical == other._glyphOrientationVertical )
389 && (_paintOrder == other._paintOrder);
385 } 390 }
386 391
387 bool operator!=(const InheritedFlags& other) const 392 bool operator!=(const InheritedFlags& other) const
388 { 393 {
389 return !(*this == other); 394 return !(*this == other);
390 } 395 }
391 396
392 unsigned _colorRendering : 2; // EColorRendering 397 unsigned _colorRendering : 2; // EColorRendering
393 unsigned _shapeRendering : 2; // EShapeRendering 398 unsigned _shapeRendering : 2; // EShapeRendering
394 unsigned _clipRule : 1; // WindRule 399 unsigned _clipRule : 1; // WindRule
395 unsigned _fillRule : 1; // WindRule 400 unsigned _fillRule : 1; // WindRule
396 unsigned _capStyle : 2; // LineCap 401 unsigned _capStyle : 2; // LineCap
397 unsigned _joinStyle : 2; // LineJoin 402 unsigned _joinStyle : 2; // LineJoin
398 unsigned _textAnchor : 2; // ETextAnchor 403 unsigned _textAnchor : 2; // ETextAnchor
399 unsigned _colorInterpolation : 2; // EColorInterpolation 404 unsigned _colorInterpolation : 2; // EColorInterpolation
400 unsigned _colorInterpolationFilters : 2; // EColorInterpolation 405 unsigned _colorInterpolationFilters : 2; // EColorInterpolation
401 unsigned _writingMode : 3; // SVGWritingMode 406 unsigned _writingMode : 3; // SVGWritingMode
402 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation 407 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation
403 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation 408 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation
409 unsigned _paintOrder : 4; // EPaintOrder
404 } svg_inherited_flags; 410 } svg_inherited_flags;
405 411
406 // don't inherit 412 // don't inherit
407 struct NonInheritedFlags { 413 struct NonInheritedFlags {
408 // 32 bit non-inherited, don't add to the struct, or the operator will b reak. 414 // 32 bit non-inherited, don't add to the struct, or the operator will b reak.
409 bool operator==(const NonInheritedFlags &other) const { return _niflags == other._niflags; } 415 bool operator==(const NonInheritedFlags &other) const { return _niflags == other._niflags; }
410 bool operator!=(const NonInheritedFlags &other) const { return _niflags != other._niflags; } 416 bool operator!=(const NonInheritedFlags &other) const { return _niflags != other._niflags; }
411 417
412 union { 418 union {
413 struct { 419 struct {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 svg_inherited_flags._fillRule = initialFillRule(); 455 svg_inherited_flags._fillRule = initialFillRule();
450 svg_inherited_flags._shapeRendering = initialShapeRendering(); 456 svg_inherited_flags._shapeRendering = initialShapeRendering();
451 svg_inherited_flags._textAnchor = initialTextAnchor(); 457 svg_inherited_flags._textAnchor = initialTextAnchor();
452 svg_inherited_flags._capStyle = initialCapStyle(); 458 svg_inherited_flags._capStyle = initialCapStyle();
453 svg_inherited_flags._joinStyle = initialJoinStyle(); 459 svg_inherited_flags._joinStyle = initialJoinStyle();
454 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); 460 svg_inherited_flags._colorInterpolation = initialColorInterpolation();
455 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati onFilters(); 461 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati onFilters();
456 svg_inherited_flags._writingMode = initialWritingMode(); 462 svg_inherited_flags._writingMode = initialWritingMode();
457 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientatio nHorizontal(); 463 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientatio nHorizontal();
458 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationV ertical(); 464 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationV ertical();
465 svg_inherited_flags._paintOrder = initialPaintOrder();
459 466
460 svg_noninherited_flags._niflags = 0; 467 svg_noninherited_flags._niflags = 0;
461 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline() ; 468 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline() ;
462 svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline(); 469 svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline();
463 svg_noninherited_flags.f._baselineShift = initialBaselineShift(); 470 svg_noninherited_flags.f._baselineShift = initialBaselineShift();
464 svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); 471 svg_noninherited_flags.f._vectorEffect = initialVectorEffect();
465 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); 472 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering();
466 svg_noninherited_flags.f.maskType = initialMaskType(); 473 svg_noninherited_flags.f.maskType = initialMaskType();
467 } 474 }
468 }; 475 };
469 476
470 } // namespace WebCore 477 } // namespace WebCore
471 478
472 #endif // ENABLE(SVG) 479 #endif // ENABLE(SVG)
473 #endif // SVGRenderStyle_h 480 #endif // SVGRenderStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698