Skia
2D Graphics Library
SkSGScene.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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 SkSGScene_DEFINED
9 #define SkSGScene_DEFINED
10 
11 #include "include/core/SkRefCnt.h"
12 #include "include/core/SkTypes.h"
13 
14 #include <memory>
15 #include <vector>
16 
17 class SkCanvas;
18 struct SkPoint;
19 
20 namespace sksg {
21 
22 class InvalidationController;
23 class RenderNode;
24 
29 class Scene final {
30 public:
31  static std::unique_ptr<Scene> Make(sk_sp<RenderNode> root);
32  ~Scene();
33  Scene(const Scene&) = delete;
34  Scene& operator=(const Scene&) = delete;
35 
36  void render(SkCanvas*) const;
38  const RenderNode* nodeAt(const SkPoint&) const;
39 
40 private:
41  explicit Scene(sk_sp<RenderNode> root);
42 
43  const sk_sp<RenderNode> fRoot;
44 };
45 
46 } // namespace sksg
47 
48 #endif // SkSGScene_DEFINED
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220
Receiver for invalidation events.
Definition: SkSGInvalidationController.h:25
Base class for nodes which can render to a canvas.
Definition: SkSGRenderNode.h:27
Holds a scene root.
Definition: SkSGScene.h:29
const RenderNode * nodeAt(const SkPoint &) const
static std::unique_ptr< Scene > Make(sk_sp< RenderNode > root)
Scene & operator=(const Scene &)=delete
Scene(const Scene &)=delete
void revalidate(InvalidationController *=nullptr)
void render(SkCanvas *) const
Definition: Skottie.h:30