blob: c94a23971234418569858a536e1cfc8b432cdc38 [file] [log] [blame]
fmalita6ceef3d2016-07-26 18:46:34 -07001/*
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
fmalitabffc2562016-08-03 10:21:11 -070011#include "SkSVGTypes.h"
fmalita6ceef3d2016-07-26 18:46:34 -070012#include "SkTLazy.h"
13
fmalita397a5172016-08-08 11:38:55 -070014class SkSVGRenderContext;
15
fmalita6ceef3d2016-07-26 18:46:34 -070016enum class SkSVGAttribute {
fmalitadc4c2a92016-08-16 15:38:51 -070017 kCx, // <circle>,<ellipse>: center x position
18 kCy, // <circle>,<ellipse>: center y position
fmalita58649cc2016-07-29 08:52:03 -070019 kD,
20 kFill,
fmalita2d961e02016-08-11 09:16:29 -070021 kFillOpacity,
fmalitabffc2562016-08-03 10:21:11 -070022 kHeight,
fmalita6fb06482016-08-15 12:45:11 -070023 kOpacity,
fmalita5b31f322016-08-12 12:15:33 -070024 kPoints,
fmalitadc4c2a92016-08-16 15:38:51 -070025 kR, // <circle>: radius
26 kRx, // <ellipse>,<rect>: horizontal (corner) radius
27 kRy, // <ellipse>,<rect>: vertical (corner) radius
fmalita58649cc2016-07-29 08:52:03 -070028 kStroke,
fmalita2d961e02016-08-11 09:16:29 -070029 kStrokeOpacity,
30 kStrokeLineCap,
31 kStrokeLineJoin,
32 kStrokeWidth,
fmalita58649cc2016-07-29 08:52:03 -070033 kTransform,
fmalita397a5172016-08-08 11:38:55 -070034 kViewBox,
fmalitabffc2562016-08-03 10:21:11 -070035 kWidth,
36 kX,
37 kY,
fmalita58649cc2016-07-29 08:52:03 -070038
39 kUnknown,
fmalita6ceef3d2016-07-26 18:46:34 -070040};
41
fmalita2d961e02016-08-11 09:16:29 -070042struct SkSVGPresentationAttributes {
43 static SkSVGPresentationAttributes MakeInitial();
fmalita6ceef3d2016-07-26 18:46:34 -070044
fmalita2d961e02016-08-11 09:16:29 -070045 // TODO: SkTLazy adds an extra ptr per attribute; refactor to reduce overhead.
fmalita6ceef3d2016-07-26 18:46:34 -070046
fmalita2d961e02016-08-11 09:16:29 -070047 SkTLazy<SkSVGPaint> fFill;
48 SkTLazy<SkSVGNumberType> fFillOpacity;
fmalita6ceef3d2016-07-26 18:46:34 -070049
fmalita2d961e02016-08-11 09:16:29 -070050 SkTLazy<SkSVGPaint> fStroke;
51 SkTLazy<SkSVGLineCap> fStrokeLineCap;
52 SkTLazy<SkSVGLineJoin> fStrokeLineJoin;
53 SkTLazy<SkSVGNumberType> fStrokeOpacity;
54 SkTLazy<SkSVGLength> fStrokeWidth;
fmalita6fb06482016-08-15 12:45:11 -070055
56 SkTLazy<SkSVGNumberType> fOpacity;
fmalita6ceef3d2016-07-26 18:46:34 -070057};
58
59#endif // SkSVGAttribute_DEFINED