aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/svg/model/SkSVGAttribute.h
blob: d05737b69fea6ce78dc186d92f7da650cd20f6ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * 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

#include "SkSVGTypes.h"
#include "SkTLazy.h"

class SkSVGRenderContext;

enum class SkSVGAttribute {
    kD,
    kFill,
    kHeight,
    kStroke,
    kTransform,
    kViewBox,
    kWidth,
    kX,
    kY,

    kUnknown,
};

class SkSVGPresentationAttributes {
public:
    SkSVGPresentationAttributes();

    void setFill(const SkSVGColorType&);
    void setStroke(const SkSVGColorType&);

    void applyTo(SkSVGRenderContext*) const;

private:
    // Color only for now.
    SkSVGColorType fFill;
    SkSVGColorType fStroke;

    unsigned fFillIsSet   : 1;
    unsigned fStrokeIsSet : 1;
};

#endif // SkSVGAttribute_DEFINED