aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/sksg/SkSGRenderNode.h
blob: 4ca1aec616401024211467864f197ffaa37d2dc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSGRenderNode_DEFINED
#define SkSGRenderNode_DEFINED

#include "SkSGNode.h"

class SkCanvas;

namespace sksg {

/**
 * Base class for nodes which can render to a canvas.
 */
class RenderNode : public Node {
public:
    // Render the node and its descendants to the canvas.
    void render(SkCanvas*) const;

protected:
    RenderNode();

    virtual void onRender(SkCanvas*) const = 0;

private:
    typedef Node INHERITED;
};

} // namespace sksg

#endif // SkSGRenderNode_DEFINED