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 | #include "SkSVGContainer.h" |
| 9 | |
| 10 | SkSVGContainer::SkSVGContainer(SkSVGTag t) : INHERITED(t) { } |
| 11 | |
| 12 | void SkSVGContainer::appendChild(sk_sp<SkSVGNode> node) { |
| 13 | SkASSERT(node); |
| 14 | fChildren.push_back(std::move(node)); |
| 15 | } |
| 16 | |
fmalita | bef51c2 | 2016-09-20 15:45:57 -0700 | [diff] [blame] | 17 | bool SkSVGContainer::hasChildren() const { |
| 18 | return !fChildren.empty(); |
| 19 | } |
| 20 | |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 21 | void SkSVGContainer::onRender(const SkSVGRenderContext& ctx) const { |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 22 | for (int i = 0; i < fChildren.count(); ++i) { |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 23 | fChildren[i]->render(ctx); |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 24 | } |
| 25 | } |