fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkSVGAttribute_DEFINED |
| 9 | #define SkSVGAttribute_DEFINED |
| 10 | |
fmalita | bffc256 | 2016-08-03 10:21:11 -0700 | [diff] [blame] | 11 | #include "SkSVGTypes.h" |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 12 | #include "SkTLazy.h" |
| 13 | |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 14 | class SkSVGRenderContext; |
| 15 | |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 16 | enum class SkSVGAttribute { |
fmalita | dc4c2a9 | 2016-08-16 15:38:51 -0700 | [diff] [blame^] | 17 | kCx, // <circle>,<ellipse>: center x position |
| 18 | kCy, // <circle>,<ellipse>: center y position |
fmalita | 58649cc | 2016-07-29 08:52:03 -0700 | [diff] [blame] | 19 | kD, |
| 20 | kFill, |
fmalita | 2d961e0 | 2016-08-11 09:16:29 -0700 | [diff] [blame] | 21 | kFillOpacity, |
fmalita | bffc256 | 2016-08-03 10:21:11 -0700 | [diff] [blame] | 22 | kHeight, |
fmalita | 6fb0648 | 2016-08-15 12:45:11 -0700 | [diff] [blame] | 23 | kOpacity, |
fmalita | 5b31f32 | 2016-08-12 12:15:33 -0700 | [diff] [blame] | 24 | kPoints, |
fmalita | dc4c2a9 | 2016-08-16 15:38:51 -0700 | [diff] [blame^] | 25 | kR, // <circle>: radius |
| 26 | kRx, // <ellipse>,<rect>: horizontal (corner) radius |
| 27 | kRy, // <ellipse>,<rect>: vertical (corner) radius |
fmalita | 58649cc | 2016-07-29 08:52:03 -0700 | [diff] [blame] | 28 | kStroke, |
fmalita | 2d961e0 | 2016-08-11 09:16:29 -0700 | [diff] [blame] | 29 | kStrokeOpacity, |
| 30 | kStrokeLineCap, |
| 31 | kStrokeLineJoin, |
| 32 | kStrokeWidth, |
fmalita | 58649cc | 2016-07-29 08:52:03 -0700 | [diff] [blame] | 33 | kTransform, |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 34 | kViewBox, |
fmalita | bffc256 | 2016-08-03 10:21:11 -0700 | [diff] [blame] | 35 | kWidth, |
| 36 | kX, |
| 37 | kY, |
fmalita | 58649cc | 2016-07-29 08:52:03 -0700 | [diff] [blame] | 38 | |
| 39 | kUnknown, |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
fmalita | 2d961e0 | 2016-08-11 09:16:29 -0700 | [diff] [blame] | 42 | struct SkSVGPresentationAttributes { |
| 43 | static SkSVGPresentationAttributes MakeInitial(); |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 44 | |
fmalita | 2d961e0 | 2016-08-11 09:16:29 -0700 | [diff] [blame] | 45 | // TODO: SkTLazy adds an extra ptr per attribute; refactor to reduce overhead. |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 46 | |
fmalita | 2d961e0 | 2016-08-11 09:16:29 -0700 | [diff] [blame] | 47 | SkTLazy<SkSVGPaint> fFill; |
| 48 | SkTLazy<SkSVGNumberType> fFillOpacity; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 49 | |
fmalita | 2d961e0 | 2016-08-11 09:16:29 -0700 | [diff] [blame] | 50 | SkTLazy<SkSVGPaint> fStroke; |
| 51 | SkTLazy<SkSVGLineCap> fStrokeLineCap; |
| 52 | SkTLazy<SkSVGLineJoin> fStrokeLineJoin; |
| 53 | SkTLazy<SkSVGNumberType> fStrokeOpacity; |
| 54 | SkTLazy<SkSVGLength> fStrokeWidth; |
fmalita | 6fb0648 | 2016-08-15 12:45:11 -0700 | [diff] [blame] | 55 | |
| 56 | SkTLazy<SkSVGNumberType> fOpacity; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | #endif // SkSVGAttribute_DEFINED |