Flutter Engine
The Flutter Engine
SkSVGGradient.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 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 SkSVGGradient_DEFINED
9#define SkSVGGradient_DEFINED
10
14
15class SkMatrix;
17class SkSVGStop;
18
20public:
21 SVG_ATTR(Href, SkSVGIRI, SkSVGIRI())
24 SVG_ATTR(GradientUnits,
27
28protected:
29 explicit SkSVGGradient(SkSVGTag t) : INHERITED(t) {}
30
31 bool parseAndSetAttribute(const char*, const char*) override;
32
33 bool onAsPaint(const SkSVGRenderContext&, SkPaint*) const final;
34
36 const SkColor4f*, const SkScalar*, int count,
37 SkTileMode, const SkMatrix& localMatrix) const = 0;
38
39private:
42 void collectColorStops(const SkSVGRenderContext&, StopPositionArray*, StopColorArray*) const;
43 SkColor4f resolveStopColor(const SkSVGRenderContext&, const SkSVGStop&) const;
44
46};
47
48#endif // SkSVGGradient_DEFINED
int count
Definition: FontMgrTest.cpp:50
#define SK_API
Definition: SkAPI.h:35
SkSVGTag
Definition: SkSVGNode.h:23
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition: SkSVGNode.h:210
SkTileMode
Definition: SkTileMode.h:13
constexpr int kPad
virtual sk_sp< SkShader > onMakeShader(const SkSVGRenderContext &, const SkColor4f *, const SkScalar *, int count, SkTileMode, const SkMatrix &localMatrix) const =0
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90
virtual bool onAsPaint(const SkSVGRenderContext &, SkPaint *) const
Definition: SkSVGNode.h:171
float SkScalar
Definition: extension.cpp:12
Definition: SkMD5.cpp:134