blob: f8338a1b3d62cdaad07d8ddeed4f04bec14184b1 [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#ifndef SkSGPlane_DEFINED
9#define SkSGPlane_DEFINED
10
11#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;
Florin Malitaeb46bd82019-02-12 09:33:21 -050028 bool onContains(const SkPoint&) const override;
Florin Malita97b3d2b2018-02-20 11:26:15 -050029
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