Skia
2D Graphics Library
SkSVGUse.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 SkSVGUse_DEFINED
9 #define SkSVGUse_DEFINED
10 
13 
18 class SK_API SkSVGUse final : public SkSVGTransformableNode {
19 public:
20  static sk_sp<SkSVGUse> Make() { return sk_sp<SkSVGUse>(new SkSVGUse()); }
21 
22  void appendChild(sk_sp<SkSVGNode>) override;
23 
26  SVG_ATTR(Href, SkSVGIRI , SkSVGIRI())
27 
28 protected:
29  bool onPrepareToRender(SkSVGRenderContext*) const override;
30  void onRender(const SkSVGRenderContext&) const override;
31  SkPath onAsPath(const SkSVGRenderContext&) const override;
32  SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
33 
34 private:
35  SkSVGUse();
36 
37  bool parseAndSetAttribute(const char*, const char*) override;
38 
40 };
41 
42 #endif // SkSVGUse_DEFINED
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition: SkSVGNode.h:203
SkPath contain geometry.
Definition: SkPath.h:58
Definition: SkRefCnt.h:119
Definition: SkSVGTypes.h:152
Definition: SkSVGTypes.h:116
Definition: SkSVGRenderContext.h:61
Definition: SkSVGTransformableNode.h:14
Implements support for <use> (reference) elements.
Definition: SkSVGUse.h:18
static sk_sp< SkSVGUse > Make()
Definition: SkSVGUse.h:20
void appendChild(sk_sp< SkSVGNode >) override
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582