• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 SkSVGContainer_DEFINED
9 #define SkSVGContainer_DEFINED
10 
11 #include "include/private/SkTArray.h"
12 #include "modules/svg/include/SkSVGTransformableNode.h"
13 
14 class SkSVGContainer : public SkSVGTransformableNode {
15 public:
16     void appendChild(sk_sp<SkSVGNode>) override;
17     std::vector<sk_sp<SkSVGNode>> getChild() override;
18 
19 protected:
20     explicit SkSVGContainer(SkSVGTag);
21 
22     void onRender(const SkSVGRenderContext&) const override;
23 
24     SkPath onAsPath(const SkSVGRenderContext&) const override;
25 
26     SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
27 
28     bool hasChildren() const final;
29 
30     // TODO: add some sort of child iterator, and hide the container.
31     SkSTArray<1, sk_sp<SkSVGNode>, true> fChildren;
32 
33 private:
34     using INHERITED = SkSVGTransformableNode;
35 };
36 
37 #endif // SkSVGContainer_DEFINED
38