Florin Malita | 97b3d2b | 2018-02-20 11:26:15 -0500 | [diff] [blame] | 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 | |
| 13 | namespace sksg { |
| 14 | |
| 15 | Plane::Plane() = default; |
| 16 | |
| 17 | void Plane::onClip(SkCanvas*, bool) const {} |
| 18 | |
| 19 | void Plane::onDraw(SkCanvas* canvas, const SkPaint& paint) const { |
| 20 | canvas->drawPaint(paint); |
| 21 | } |
| 22 | |
Florin Malita | eb46bd8 | 2019-02-12 09:33:21 -0500 | [diff] [blame] | 23 | bool Plane::onContains(const SkPoint&) const { return true; } |
| 24 | |
Florin Malita | 97b3d2b | 2018-02-20 11:26:15 -0500 | [diff] [blame] | 25 | SkRect Plane::onRevalidate(InvalidationController*, const SkMatrix&) { |
| 26 | SkASSERT(this->hasInval()); |
| 27 | |
| 28 | return SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax); |
| 29 | } |
| 30 | |
| 31 | SkPath Plane::onAsPath() const { |
| 32 | SkPath path; |
| 33 | path.setFillType(SkPath::kInverseWinding_FillType); |
| 34 | |
| 35 | return path; |
| 36 | } |
| 37 | |
| 38 | } // namespace sksg |