Flutter Engine
The Flutter Engine
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
11#include "include/core/SkRect.h"
16
17#include <utility>
18
19class SkCanvas;
20class SkMatrix;
21struct SkPoint;
22
23namespace sksg {
24class InvalidationController;
25
26/**
27 * Concrete rendering node.
28 *
29 * Wraps and draws a [geometry, paint] tuple.
30 *
31 * Think Skia SkCanvas::drawFoo(foo, paint) calls.
32 */
33class Draw : public RenderNode {
34public:
36 return (geo && paint) ? sk_sp<Draw>(new Draw(std::move(geo), std::move(paint))) : nullptr;
37 }
38
39protected:
41 ~Draw() override;
42
43 void onRender(SkCanvas*, const RenderContext*) const override;
44 const RenderNode* onNodeAt(const SkPoint&) const override;
45
47
48private:
49 sk_sp<GeometryNode> fGeometry;
50 sk_sp<PaintNode> fPaint;
51
52 using INHERITED = RenderNode;
53};
54
55} // namespace sksg
56
57#endif // SkSGDraw_DEFINED
SkRect onRevalidate(InvalidationController *, const SkMatrix &) override
Definition: SkSGDraw.cpp:68
~Draw() override
Definition: SkSGDraw.cpp:30
void onRender(SkCanvas *, const RenderContext *) const override
Definition: SkSGDraw.cpp:35
static sk_sp< Draw > Make(sk_sp< GeometryNode > geo, sk_sp< PaintNode > paint)
Definition: SkSGDraw.h:35
const RenderNode * onNodeAt(const SkPoint &) const override
Definition: SkSGDraw.cpp:49
Draw(sk_sp< GeometryNode >, sk_sp< PaintNode > paint)
Definition: SkSGDraw.cpp:23
friend class RenderNode
Definition: SkSGNode.h:94
const Paint & paint
Definition: color_source.cc:38
Definition: Skottie.h:32