fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "experimental/svg/model/SkSVGTransformableNode.h" |
| 12 | #include "include/private/SkTArray.h" |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 13 | |
| 14 | class SkSVGContainer : public SkSVGTransformableNode { |
| 15 | public: |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame] | 16 | ~SkSVGContainer() override = default; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 17 | |
| 18 | void appendChild(sk_sp<SkSVGNode>) override; |
| 19 | |
| 20 | protected: |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 21 | explicit SkSVGContainer(SkSVGTag); |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 22 | |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 23 | void onRender(const SkSVGRenderContext&) const override; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 24 | |
Florin Malita | ce8840e | 2016-12-08 09:26:47 -0500 | [diff] [blame] | 25 | SkPath onAsPath(const SkSVGRenderContext&) const override; |
| 26 | |
fmalita | bef51c2 | 2016-09-20 15:45:57 -0700 | [diff] [blame] | 27 | bool hasChildren() const final; |
| 28 | |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 29 | // TODO: add some sort of child iterator, and hide the container. |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 30 | SkSTArray<1, sk_sp<SkSVGNode>, true> fChildren; |
| 31 | |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 32 | private: |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame^] | 33 | using INHERITED = SkSVGTransformableNode; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
Florin Malita | 6a69c05 | 2017-10-11 14:02:11 -0400 | [diff] [blame] | 36 | #endif // SkSVGContainer_DEFINED |