blob: 989f40c2d022efdb63d58c003cb743bef6fa4229 [file] [log] [blame]
Florin Malita97b3d2b2018-02-20 11:26:15 -05001/*
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
Florin Malitaeb46bd82019-02-12 09:33:21 -050023bool Plane::onContains(const SkPoint&) const { return true; }
24
Florin Malita97b3d2b2018-02-20 11:26:15 -050025SkRect Plane::onRevalidate(InvalidationController*, const SkMatrix&) {
26 SkASSERT(this->hasInval());
27
28 return SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax);
29}
30
31SkPath Plane::onAsPath() const {
32 SkPath path;
33 path.setFillType(SkPath::kInverseWinding_FillType);
34
35 return path;
36}
37
38} // namespace sksg