2 * Copyright 2016 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkSVGAttribute_DEFINED
9 #define SkSVGAttribute_DEFINED
11 #include "modules/svg/include/SkSVGTypes.h"
12 #include "src/core/SkTLazy.h"
14 class SkSVGRenderContext;
16 enum class SkSVGAttribute {
20 kColorInterpolationFilters,
21 kCx, // <circle>, <ellipse>, <radialGradient>: center x position
22 kCy, // <circle>, <ellipse>, <radialGradient>: center y position
32 kFx, // <radialGradient>: focal point x position
33 kFy, // <radialGradient>: focal point y position
41 kR, // <circle>, <radialGradient>: radius
42 kRx, // <ellipse>,<rect>: horizontal (corner) radius
43 kRy, // <ellipse>,<rect>: vertical (corner) radius
60 kX1, // <line>: first endpoint x
61 kX2, // <line>: second endpoint x
63 kY1, // <line>: first endpoint y
64 kY2, // <line>: second endpoint y
69 struct SkSVGPresentationAttributes {
70 static SkSVGPresentationAttributes MakeInitial();
72 // TODO: SkSVGProperty adds an extra ptr per attribute; refactor to reduce overhead.
74 SkSVGProperty<SkSVGPaint , true> fFill;
75 SkSVGProperty<SkSVGNumberType, true> fFillOpacity;
76 SkSVGProperty<SkSVGFillRule , true> fFillRule;
77 SkSVGProperty<SkSVGFillRule , true> fClipRule;
79 SkSVGProperty<SkSVGPaint , true> fStroke;
80 SkSVGProperty<SkSVGDashArray , true> fStrokeDashArray;
81 SkSVGProperty<SkSVGLength , true> fStrokeDashOffset;
82 SkSVGProperty<SkSVGLineCap , true> fStrokeLineCap;
83 SkSVGProperty<SkSVGLineJoin , true> fStrokeLineJoin;
84 SkSVGProperty<SkSVGNumberType, true> fStrokeMiterLimit;
85 SkSVGProperty<SkSVGNumberType, true> fStrokeOpacity;
86 SkSVGProperty<SkSVGLength , true> fStrokeWidth;
88 SkSVGProperty<SkSVGVisibility, true> fVisibility;
90 SkSVGProperty<SkSVGColorType , true> fColor;
91 SkSVGProperty<SkSVGColorspace, true> fColorInterpolation;
92 SkSVGProperty<SkSVGColorspace, true> fColorInterpolationFilters;
94 SkSVGProperty<SkSVGFontFamily, true> fFontFamily;
95 SkSVGProperty<SkSVGFontStyle , true> fFontStyle;
96 SkSVGProperty<SkSVGFontSize , true> fFontSize;
97 SkSVGProperty<SkSVGFontWeight, true> fFontWeight;
98 SkSVGProperty<SkSVGTextAnchor, true> fTextAnchor;
101 SkSVGProperty<SkSVGNumberType, false> fOpacity;
102 SkSVGProperty<SkSVGFuncIRI , false> fClipPath;
103 SkSVGProperty<SkSVGDisplay , false> fDisplay;
104 SkSVGProperty<SkSVGFuncIRI , false> fMask;
105 SkSVGProperty<SkSVGFuncIRI , false> fFilter;
106 SkSVGProperty<SkSVGColor , false> fStopColor;
107 SkSVGProperty<SkSVGNumberType, false> fStopOpacity;
108 SkSVGProperty<SkSVGColor , false> fFloodColor;
109 SkSVGProperty<SkSVGNumberType, false> fFloodOpacity;
110 SkSVGProperty<SkSVGColor , false> fLightingColor;
113 #endif // SkSVGAttribute_DEFINED