/src/skia/modules/sksg/src/SkSGGeometryNode.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2017 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 "modules/sksg/include/SkSGGeometryNode.h" |
9 | | |
10 | | #include "include/core/SkPath.h" |
11 | | #include "include/core/SkPoint.h" |
12 | | #include "include/core/SkRect.h" |
13 | | #include "include/private/base/SkAssert.h" |
14 | | |
15 | | namespace sksg { |
16 | | |
17 | | // Geometry nodes don't generate damage on their own, but via their aggregation ancestor Draw nodes. |
18 | 2.71M | GeometryNode::GeometryNode() : INHERITED(kBubbleDamage_Trait) {} |
19 | | |
20 | 22.4k | void GeometryNode::clip(SkCanvas* canvas, bool aa) const { |
21 | 22.4k | SkASSERT(!this->hasInval()); |
22 | 22.4k | this->onClip(canvas, aa); |
23 | 22.4k | } |
24 | | |
25 | 41.2k | void GeometryNode::draw(SkCanvas* canvas, const SkPaint& paint) const { |
26 | 41.2k | SkASSERT(!this->hasInval()); |
27 | 41.2k | this->onDraw(canvas, paint); |
28 | 41.2k | } |
29 | | |
30 | 0 | bool GeometryNode::contains(const SkPoint& p) const { |
31 | 0 | SkASSERT(!this->hasInval()); |
32 | 0 | return this->bounds().contains(p.x(), p.y()) ? this->onContains(p) : false; |
33 | 0 | } |
34 | | |
35 | 2.74M | SkPath GeometryNode::asPath() const { |
36 | 2.74M | SkASSERT(!this->hasInval()); |
37 | 2.74M | return this->onAsPath(); |
38 | 2.74M | } |
39 | | |
40 | | } // namespace sksg |