skia2/experimental/sksg/geometry/SkSGPlane.cpp
Florin Malita 97b3d2bcdb [sksg] Add 'plane' geometry node
SG geometry corresponding to SkCanvas::drawPaint().

TBR=

Change-Id: I3b368adda187fb92f524756496a3694c03a3113d
Reviewed-on: https://skia-review.googlesource.com/108562
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-02-20 17:08:53 +00:00

37 lines
742 B
C++

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkSGPlane.h"
#include "SkCanvas.h"
#include "SkPath.h"
namespace sksg {
Plane::Plane() = default;
void Plane::onClip(SkCanvas*, bool) const {}
void Plane::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
canvas->drawPaint(paint);
}
SkRect Plane::onRevalidate(InvalidationController*, const SkMatrix&) {
SkASSERT(this->hasInval());
return SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax);
}
SkPath Plane::onAsPath() const {
SkPath path;
path.setFillType(SkPath::kInverseWinding_FillType);
return path;
}
} // namespace sksg