Flutter Engine
The Flutter Engine
SkSVGImage.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 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 SkSVGImage_DEFINED
9#define SkSVGImage_DEFINED
10
13
14namespace skresources {
16}
17
19public:
21 return sk_sp<SkSVGImage>(new SkSVGImage());
22 }
23
25 SkDebugf("cannot append child nodes to this element.\n");
26 }
27
28 bool onPrepareToRender(SkSVGRenderContext*) const override;
29 void onRender(const SkSVGRenderContext&) const override;
30 SkPath onAsPath(const SkSVGRenderContext&) const override;
31 SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
32
33 struct ImageInfo {
36 };
38 const SkSVGIRI&,
39 const SkRect&,
41
44 SVG_ATTR(Width , SkSVGLength , SkSVGLength(0))
45 SVG_ATTR(Height , SkSVGLength , SkSVGLength(0))
46 SVG_ATTR(Href , SkSVGIRI , SkSVGIRI())
48
49protected:
50 bool parseAndSetAttribute(const char*, const char*) override;
51
52private:
54
56};
57
58#endif // SkSVGImage_DEFINED
#define SK_API
Definition: SkAPI.h:35
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
SkSVGTag
Definition: SkSVGNode.h:23
#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
Definition: SkPath.h:59
void appendChild(sk_sp< SkSVGNode >) override
Definition: SkSVGImage.h:24
static sk_sp< SkSVGImage > Make()
Definition: SkSVGImage.h:20
virtual SkRect onObjectBoundingBox(const SkSVGRenderContext &) const
Definition: SkSVGNode.h:179
virtual void onRender(const SkSVGRenderContext &) const =0
virtual SkPath onAsPath(const SkSVGRenderContext &) const =0
bool onPrepareToRender(SkSVGRenderContext *) const override
sk_sp< SkImage > fImage
Definition: SkSVGImage.h:34
#define LoadImage