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 "SkSGGeometryNode.h"
9 
10 #include "SkPath.h"
11 
12 namespace sksg {
13 
14 // Geometry nodes don't generate damage on their own, but via their aggregation ancestor Draw nodes.
GeometryNode()15 GeometryNode::GeometryNode() : INHERITED(kBubbleDamage_Trait) {}
16 
clip(SkCanvas * canvas,bool aa) const17 void GeometryNode::clip(SkCanvas* canvas, bool aa) const {
18     SkASSERT(!this->hasInval());
19     this->onClip(canvas, aa);
20 }
21 
draw(SkCanvas * canvas,const SkPaint & paint) const22 void GeometryNode::draw(SkCanvas* canvas, const SkPaint& paint) const {
23     SkASSERT(!this->hasInval());
24     this->onDraw(canvas, paint);
25 }
26 
asPath() const27 SkPath GeometryNode::asPath() const {
28     SkASSERT(!this->hasInval());
29     return this->onAsPath();
30 }
31 
32 } // namespace sksg
33