97b3d2bcdb
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>
37 lines
742 B
C++
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
|