blob: 2ffbc5c852e798916ea85d51db4cdaede3b780dd [file] [log] [blame]
fmalita28d5b722016-09-12 17:06:47 -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 SkSVGStop_DEFINED
9#define SkSVGStop_DEFINED
10
11#include "SkSVGHiddenContainer.h"
12#include "SkSVGTypes.h"
13
14class SkSVGLengthContext;
15
16class SkSVGStop : public SkSVGHiddenContainer {
17public:
18 virtual ~SkSVGStop() = default;
19 static sk_sp<SkSVGStop> Make() {
20 return sk_sp<SkSVGStop>(new SkSVGStop());
21 }
22
23 const SkSVGLength& offset() const { return fOffset; }
24 const SkSVGColorType& stopColor() const { return fStopColor; }
25 const SkSVGNumberType& stopOpacity() const { return fStopOpacity; }
26
27 void setOffset(const SkSVGLength&);
28 void setStopColor(const SkSVGColorType&);
29 void setStopOpacity(const SkSVGNumberType&);
30
31protected:
32 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
33
34private:
35 SkSVGStop();
36
37 SkSVGLength fOffset = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
38 SkSVGColorType fStopColor = SkSVGColorType(SK_ColorBLACK);
39 SkSVGNumberType fStopOpacity = SkSVGNumberType(1);
40
41 typedef SkSVGHiddenContainer INHERITED;
42};
43
44#endif // SkSVGStop_DEFINED