• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
13 class SkCanvas;
14 class SkPaint;
15 
16 namespace sksg {
17 
18 /**
19  * Concrete Geometry node, representing the whole canvas.
20  */
21 class Plane final : public GeometryNode {
22 public:
Make()23     static sk_sp<Plane> Make() { return sk_sp<Plane>(new Plane()); }
24 
25 protected:
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 
33 private:
34     Plane();
35 
36     using INHERITED = GeometryNode;
37 };
38 
39 } // namespace sksg
40 
41 #endif // SkSGPlane_DEFINED
42