2017-12-19 17:21:02 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "SkSGGeometryNode.h"
|
|
|
|
|
2018-01-04 04:37:54 +00:00
|
|
|
#include "SkPath.h"
|
|
|
|
|
2017-12-19 17:21:02 +00:00
|
|
|
namespace sksg {
|
|
|
|
|
2018-01-05 16:32:31 +00:00
|
|
|
// Geometry nodes don't generate damage on their own, but via their aggregation ancestor Draw nodes.
|
|
|
|
GeometryNode::GeometryNode() : INHERITED(kBubbleDamage_Trait) {}
|
|
|
|
|
2018-01-29 21:31:14 +00:00
|
|
|
void GeometryNode::clip(SkCanvas* canvas, bool aa) const {
|
|
|
|
SkASSERT(!this->hasInval());
|
|
|
|
this->onClip(canvas, aa);
|
|
|
|
}
|
|
|
|
|
2017-12-19 17:21:02 +00:00
|
|
|
void GeometryNode::draw(SkCanvas* canvas, const SkPaint& paint) const {
|
2018-01-03 21:17:29 +00:00
|
|
|
SkASSERT(!this->hasInval());
|
2017-12-19 17:21:02 +00:00
|
|
|
this->onDraw(canvas, paint);
|
|
|
|
}
|
|
|
|
|
2018-01-04 04:37:54 +00:00
|
|
|
SkPath GeometryNode::asPath() const {
|
|
|
|
SkASSERT(!this->hasInval());
|
|
|
|
return this->onAsPath();
|
|
|
|
}
|
|
|
|
|
2017-12-19 17:21:02 +00:00
|
|
|
} // namespace sksg
|