blob: 560271854f5b61ebeaee8d2d21a5d0a1d51dbb92 [file] [log] [blame]
Florin Malitab3418102020-10-15 18:10:29 -04001/*
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
14class SkSVGContainer : public SkSVGTransformableNode {
15public:
Florin Malitab3418102020-10-15 18:10:29 -040016 void appendChild(sk_sp<SkSVGNode>) override;
17
18protected:
19 explicit SkSVGContainer(SkSVGTag);
20
21 void onRender(const SkSVGRenderContext&) const override;
22
23 SkPath onAsPath(const SkSVGRenderContext&) const override;
24
Tyler Dennistonf548a022020-10-27 15:02:02 -040025 SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
26
Florin Malitab3418102020-10-15 18:10:29 -040027 bool hasChildren() const final;
28
29 // TODO: add some sort of child iterator, and hide the container.
30 SkSTArray<1, sk_sp<SkSVGNode>, true> fChildren;
31
32private:
33 using INHERITED = SkSVGTransformableNode;
34};
35
36#endif // SkSVGContainer_DEFINED