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#ifndef SkSGPlane_DEFINED
9#define SkSGPlane_DEFINED
10
11#include "modules/sksg/include/SkSGGeometryNode.h"
12
13class SkCanvas;
14class SkPaint;
15
16namespace sksg {
17
18/**
19 * Concrete Geometry node, representing the whole canvas.
20 */
21class Plane final : public GeometryNode {
22public:
23 static sk_sp<Plane> Make() { return sk_sp<Plane>(new Plane()); }
24
25protected:
26 void onClip(SkCanvas*, bool antiAlias) const override;
27 void onDraw(SkCanvas*, const SkPaint&) const override;
28 bool onContains(const SkPoint&) const override;
29
30 SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
31 SkPath onAsPath() const override;
32
33private:
34 Plane();
35
36 using INHERITED = GeometryNode;
37};
38
39} // namespace sksg
40
41#endif // SkSGPlane_DEFINED
42