OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkSVGContainer.h" | 8 #include "SkSVGContainer.h" |
9 | 9 |
10 SkSVGContainer::SkSVGContainer(SkSVGTag t) : INHERITED(t) { } | 10 SkSVGContainer::SkSVGContainer(SkSVGTag t) : INHERITED(t) { } |
11 | 11 |
12 void SkSVGContainer::appendChild(sk_sp<SkSVGNode> node) { | 12 void SkSVGContainer::appendChild(sk_sp<SkSVGNode> node) { |
13 SkASSERT(node); | 13 SkASSERT(node); |
14 fChildren.push_back(std::move(node)); | 14 fChildren.push_back(std::move(node)); |
15 } | 15 } |
16 | 16 |
| 17 bool SkSVGContainer::hasChildren() const { |
| 18 return !fChildren.empty(); |
| 19 } |
| 20 |
17 void SkSVGContainer::onRender(const SkSVGRenderContext& ctx) const { | 21 void SkSVGContainer::onRender(const SkSVGRenderContext& ctx) const { |
18 for (int i = 0; i < fChildren.count(); ++i) { | 22 for (int i = 0; i < fChildren.count(); ++i) { |
19 fChildren[i]->render(ctx); | 23 fChildren[i]->render(ctx); |
20 } | 24 } |
21 } | 25 } |
OLD | NEW |