1/*
2 * Copyright 2018 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 "SkSGPlane.h"
9
10#include "SkCanvas.h"
11#include "SkPath.h"
12
13namespace sksg {
14
15Plane::Plane() = default;
16
17void Plane::onClip(SkCanvas*, bool) const {}
18
19void Plane::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
20    canvas->drawPaint(paint);
21}
22
23SkRect Plane::onRevalidate(InvalidationController*, const SkMatrix&) {
24    SkASSERT(this->hasInval());
25
26    return SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax);
27}
28
29SkPath Plane::onAsPath() const {
30    SkPath path;
31    path.setFillType(SkPath::kInverseWinding_FillType);
32
33    return path;
34}
35
36} // namespace sksg
37