2018-02-20 16:26:15 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "modules/sksg/include/SkSGGeometryNode.h"
|
2018-02-20 16:26:15 +00:00
|
|
|
|
|
|
|
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;
|
2019-02-12 14:33:21 +00:00
|
|
|
bool onContains(const SkPoint&) const override;
|
2018-02-20 16:26:15 +00:00
|
|
|
|
|
|
|
SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
|
|
|
|
SkPath onAsPath() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Plane();
|
|
|
|
|
|
|
|
using INHERITED = GeometryNode;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace sksg
|
|
|
|
|
|
|
|
#endif // SkSGPlane_DEFINED
|