Skia
2D Graphics Library
SkSGDraw.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 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 SkSGDraw_DEFINED
9 #define SkSGDraw_DEFINED
10 
14 
15 namespace sksg {
16 
24 class Draw : public RenderNode {
25 public:
27  return (geo && paint) ? sk_sp<Draw>(new Draw(std::move(geo), std::move(paint))) : nullptr;
28  }
29 
30 protected:
32  ~Draw() override;
33 
34  void onRender(SkCanvas*, const RenderContext*) const override;
35  const RenderNode* onNodeAt(const SkPoint&) const override;
36 
38 
39 private:
40  sk_sp<GeometryNode> fGeometry;
41  sk_sp<PaintNode> fPaint;
42 
43  using INHERITED = RenderNode;
44 };
45 
46 } // namespace sksg
47 
48 #endif // SkSGDraw_DEFINED
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220
Concrete rendering node.
Definition: SkSGDraw.h:24
SkRect onRevalidate(InvalidationController *, const SkMatrix &) override
~Draw() override
void onRender(SkCanvas *, const RenderContext *) const override
static sk_sp< Draw > Make(sk_sp< GeometryNode > geo, sk_sp< PaintNode > paint)
Definition: SkSGDraw.h:26
const RenderNode * onNodeAt(const SkPoint &) const override
Draw(sk_sp< GeometryNode >, sk_sp< PaintNode > paint)
Receiver for invalidation events.
Definition: SkSGInvalidationController.h:25
friend class RenderNode
Definition: SkSGNode.h:93
Base class for nodes which can render to a canvas.
Definition: SkSGRenderNode.h:27
Definition: Skottie.h:30
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582
Definition: SkSGRenderNode.h:53