Flutter Engine
The Flutter Engine
SkSVGPattern.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 SkSVGPattern_DEFINED
9#define SkSVGPattern_DEFINED
10
13
15
17public:
20 }
21
22 SVG_ATTR(Href, SkSVGIRI, SkSVGIRI())
27 SVG_OPTIONAL_ATTR(PatternTransform, SkSVGTransformType)
28
29protected:
31
32 bool parseAndSetAttribute(const char*, const char*) override;
33
34 bool onAsPaint(const SkSVGRenderContext&, SkPaint*) const override;
35
36private:
37 struct PatternAttributes {
39 fY,
40 fWidth,
41 fHeight;
42 SkTLazy<SkSVGTransformType> fPatternTransform;
43 };
44
45 const SkSVGPattern* resolveHref(const SkSVGRenderContext&, PatternAttributes*) const;
46 const SkSVGPattern* hrefTarget(const SkSVGRenderContext&) const;
47
48 // TODO:
49 // - patternUnits
50 // - patternContentUnits
51
53};
54
55#endif // SkSVGPattern_DEFINED
#define SK_API
Definition: SkAPI.h:35
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
#define SVG_OPTIONAL_ATTR(attr_name, attr_type)
Definition: SkSVGNode.h:220
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition: SkSVGNode.h:210
static const SkScalar Y
Definition: StrokeBench.cpp:55
static const SkScalar X
Definition: StrokeBench.cpp:54
static sk_sp< SkSVGPattern > Make()
Definition: SkSVGPattern.h:18