2016-07-27 01:46:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkSVGAttribute_DEFINED
|
|
|
|
#define SkSVGAttribute_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "experimental/svg/model/SkSVGTypes.h"
|
|
|
|
#include "src/core/SkTLazy.h"
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-08 18:38:55 +00:00
|
|
|
class SkSVGRenderContext;
|
|
|
|
|
2016-07-27 01:46:34 +00:00
|
|
|
enum class SkSVGAttribute {
|
2016-12-08 14:26:47 +00:00
|
|
|
kClipPath,
|
2017-10-10 15:22:08 +00:00
|
|
|
kClipRule,
|
2017-10-09 20:05:30 +00:00
|
|
|
kCx, // <circle>, <ellipse>, <radialGradient>: center x position
|
|
|
|
kCy, // <circle>, <ellipse>, <radialGradient>: center y position
|
2016-07-29 15:52:03 +00:00
|
|
|
kD,
|
|
|
|
kFill,
|
2016-08-11 16:16:29 +00:00
|
|
|
kFillOpacity,
|
2016-12-01 18:35:11 +00:00
|
|
|
kFillRule,
|
2017-10-09 20:05:30 +00:00
|
|
|
kFx, // <radialGradient>: focal point x position
|
|
|
|
kFy, // <radialGradient>: focal point y position
|
2016-09-13 20:59:05 +00:00
|
|
|
kGradientTransform,
|
2016-08-03 17:21:11 +00:00
|
|
|
kHeight,
|
2016-09-13 00:06:47 +00:00
|
|
|
kHref,
|
|
|
|
kOffset,
|
2016-08-15 19:45:11 +00:00
|
|
|
kOpacity,
|
2017-10-11 18:34:33 +00:00
|
|
|
kPatternTransform,
|
2016-08-12 19:15:33 +00:00
|
|
|
kPoints,
|
2017-10-09 20:05:30 +00:00
|
|
|
kR, // <circle>, <radialGradient>: radius
|
2016-08-16 22:38:51 +00:00
|
|
|
kRx, // <ellipse>,<rect>: horizontal (corner) radius
|
|
|
|
kRy, // <ellipse>,<rect>: vertical (corner) radius
|
2016-09-13 19:56:11 +00:00
|
|
|
kSpreadMethod,
|
2016-09-13 00:06:47 +00:00
|
|
|
kStopColor,
|
|
|
|
kStopOpacity,
|
2016-07-29 15:52:03 +00:00
|
|
|
kStroke,
|
2017-10-13 18:07:44 +00:00
|
|
|
kStrokeDashArray,
|
2017-10-13 22:18:32 +00:00
|
|
|
kStrokeDashOffset,
|
2016-08-11 16:16:29 +00:00
|
|
|
kStrokeOpacity,
|
|
|
|
kStrokeLineCap,
|
|
|
|
kStrokeLineJoin,
|
2017-10-09 16:57:41 +00:00
|
|
|
kStrokeMiterLimit,
|
2016-08-11 16:16:29 +00:00
|
|
|
kStrokeWidth,
|
2016-07-29 15:52:03 +00:00
|
|
|
kTransform,
|
2016-08-08 18:38:55 +00:00
|
|
|
kViewBox,
|
2017-10-12 15:33:28 +00:00
|
|
|
kVisibility,
|
2016-08-03 17:21:11 +00:00
|
|
|
kWidth,
|
|
|
|
kX,
|
2016-08-17 15:38:15 +00:00
|
|
|
kX1, // <line>: first endpoint x
|
|
|
|
kX2, // <line>: second endpoint x
|
2016-08-03 17:21:11 +00:00
|
|
|
kY,
|
2016-08-17 15:38:15 +00:00
|
|
|
kY1, // <line>: first endpoint y
|
|
|
|
kY2, // <line>: second endpoint y
|
2016-07-29 15:52:03 +00:00
|
|
|
|
|
|
|
kUnknown,
|
2016-07-27 01:46:34 +00:00
|
|
|
};
|
|
|
|
|
2016-08-11 16:16:29 +00:00
|
|
|
struct SkSVGPresentationAttributes {
|
|
|
|
static SkSVGPresentationAttributes MakeInitial();
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-11 16:16:29 +00:00
|
|
|
// TODO: SkTLazy adds an extra ptr per attribute; refactor to reduce overhead.
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-11 16:16:29 +00:00
|
|
|
SkTLazy<SkSVGPaint> fFill;
|
|
|
|
SkTLazy<SkSVGNumberType> fFillOpacity;
|
2016-12-01 18:35:11 +00:00
|
|
|
SkTLazy<SkSVGFillRule> fFillRule;
|
2017-10-10 15:22:08 +00:00
|
|
|
SkTLazy<SkSVGFillRule> fClipRule;
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-11 16:16:29 +00:00
|
|
|
SkTLazy<SkSVGPaint> fStroke;
|
2017-10-13 18:07:44 +00:00
|
|
|
SkTLazy<SkSVGDashArray> fStrokeDashArray;
|
2017-10-13 22:18:32 +00:00
|
|
|
SkTLazy<SkSVGLength> fStrokeDashOffset;
|
2016-08-11 16:16:29 +00:00
|
|
|
SkTLazy<SkSVGLineCap> fStrokeLineCap;
|
|
|
|
SkTLazy<SkSVGLineJoin> fStrokeLineJoin;
|
2017-10-09 16:57:41 +00:00
|
|
|
SkTLazy<SkSVGNumberType> fStrokeMiterLimit;
|
2016-08-11 16:16:29 +00:00
|
|
|
SkTLazy<SkSVGNumberType> fStrokeOpacity;
|
|
|
|
SkTLazy<SkSVGLength> fStrokeWidth;
|
2016-08-15 19:45:11 +00:00
|
|
|
|
2017-10-12 15:33:28 +00:00
|
|
|
SkTLazy<SkSVGVisibility> fVisibility;
|
|
|
|
|
2016-12-08 14:26:47 +00:00
|
|
|
// uninherited
|
2016-08-15 19:45:11 +00:00
|
|
|
SkTLazy<SkSVGNumberType> fOpacity;
|
2016-12-08 14:26:47 +00:00
|
|
|
SkTLazy<SkSVGClip> fClipPath;
|
2016-07-27 01:46:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SkSVGAttribute_DEFINED
|