2 * Copyright 2017 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "modules/sksg/include/SkSGGeometryNode.h"
10 #include "include/core/SkPath.h"
14 // Geometry nodes don't generate damage on their own, but via their aggregation ancestor Draw nodes.
15 GeometryNode::GeometryNode() : INHERITED(kBubbleDamage_Trait) {}
17 void GeometryNode::clip(SkCanvas* canvas, bool aa) const {
18 SkASSERT(!this->hasInval());
19 this->onClip(canvas, aa);
22 void GeometryNode::draw(SkCanvas* canvas, const SkPaint& paint) const {
23 SkASSERT(!this->hasInval());
24 this->onDraw(canvas, paint);
27 bool GeometryNode::contains(const SkPoint& p) const {
28 SkASSERT(!this->hasInval());
29 return this->bounds().contains(p.x(), p.y()) ? this->onContains(p) : false;
32 SkPath GeometryNode::asPath() const {
33 SkASSERT(!this->hasInval());
34 return this->onAsPath();