blob: af19608d25036d2fe1e29e76f54c5f294f0e6ddd [file] [log] [blame]
fmalita6ceef3d2016-07-26 18:46:34 -07001/*
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
10SkSVGContainer::SkSVGContainer(SkSVGTag t) : INHERITED(t) { }
11
12void SkSVGContainer::appendChild(sk_sp<SkSVGNode> node) {
13 SkASSERT(node);
14 fChildren.push_back(std::move(node));
15}
16
fmalitabef51c22016-09-20 15:45:57 -070017bool SkSVGContainer::hasChildren() const {
18 return !fChildren.empty();
19}
20
fmalita397a5172016-08-08 11:38:55 -070021void SkSVGContainer::onRender(const SkSVGRenderContext& ctx) const {
fmalita6ceef3d2016-07-26 18:46:34 -070022 for (int i = 0; i < fChildren.count(); ++i) {
fmalita397a5172016-08-08 11:38:55 -070023 fChildren[i]->render(ctx);
fmalita6ceef3d2016-07-26 18:46:34 -070024 }
25}