aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/sksg/geometry/SkSGPlane.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-02-20 11:26:15 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-20 17:08:53 +0000
commit97b3d2bcdb862b13a6a3f7a0b263bd04e2b8f911 (patch)
tree7e24a6a6c8dc301e303281f67504cbd8d9116043 /experimental/sksg/geometry/SkSGPlane.h
parent2a552179cc20f4d198c9035106df226c36f5e8c9 (diff)
[sksg] Add 'plane' geometry node
SG geometry corresponding to SkCanvas::drawPaint(). TBR= Change-Id: I3b368adda187fb92f524756496a3694c03a3113d Reviewed-on: https://skia-review.googlesource.com/108562 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/sksg/geometry/SkSGPlane.h')
-rw-r--r--experimental/sksg/geometry/SkSGPlane.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/experimental/sksg/geometry/SkSGPlane.h b/experimental/sksg/geometry/SkSGPlane.h
new file mode 100644
index 0000000000..c0a26375b2
--- /dev/null
+++ b/experimental/sksg/geometry/SkSGPlane.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkSGPlane_DEFINED
+#define SkSGPlane_DEFINED
+
+#include "SkSGGeometryNode.h"
+
+class SkCanvas;
+class SkPaint;
+
+namespace sksg {
+
+/**
+ * Concrete Geometry node, representing the whole canvas.
+ */
+class Plane final : public GeometryNode {
+public:
+ static sk_sp<Plane> Make() { return sk_sp<Plane>(new Plane()); }
+
+protected:
+ void onClip(SkCanvas*, bool antiAlias) const override;
+ void onDraw(SkCanvas*, const SkPaint&) const override;
+
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
+ SkPath onAsPath() const override;
+
+private:
+ Plane();
+
+ using INHERITED = GeometryNode;
+};
+
+} // namespace sksg
+
+#endif // SkSGPlane_DEFINED