Flutter Engine
The Flutter Engine
SkSVGContainer.cpp
Go to the documentation of this file.
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
9
10#include "include/core/SkPath.h"
12
14
16 SkASSERT(node);
17 fChildren.push_back(std::move(node));
18}
19
21 return !fChildren.empty();
22}
23
25 for (int i = 0; i < fChildren.size(); ++i) {
26 fChildren[i]->render(ctx);
27 }
28}
29
32
33 for (int i = 0; i < fChildren.size(); ++i) {
34 const SkPath childPath = fChildren[i]->asPath(ctx);
35
36 Op(path, childPath, kUnion_SkPathOp, &path);
37 }
38
39 this->mapToParent(&path);
40 return path;
41}
42
45
46 for (int i = 0; i < fChildren.size(); ++i) {
47 const SkRect childBounds = fChildren[i]->objectBoundingBox(ctx);
48 bounds.join(childBounds);
49 }
50
51 return bounds;
52}
#define SkASSERT(cond)
Definition: SkAssert.h:116
@ kUnion_SkPathOp
union (inclusive-or) the two paths
Definition: SkPathOps.h:25
SkSVGTag
Definition: SkSVGNode.h:23
Definition: SkPath.h:59
void onRender(const SkSVGRenderContext &) const override
SkRect onObjectBoundingBox(const SkSVGRenderContext &) const override
bool hasChildren() const final
void appendChild(sk_sp< SkSVGNode >) override
SkPath onAsPath(const SkSVGRenderContext &) const override
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
SkSVGContainer(SkSVGTag)
void mapToParent(SkPath *) const
bool empty() const
Definition: SkTArray.h:199
int size() const
Definition: SkTArray.h:421
Optional< SkRect > bounds
Definition: SkRecords.h:189
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
static constexpr SkRect MakeEmpty()
Definition: SkRect.h:595