Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSGScene.cpp
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
11
12#include <utility>
13
14namespace sksg {
15
16std::unique_ptr<Scene> Scene::Make(sk_sp<RenderNode> root) {
17 return root ? std::unique_ptr<Scene>(new Scene(std::move(root))) : nullptr;
18}
19
20Scene::Scene(sk_sp<RenderNode> root) : fRoot(std::move(root)) {}
21
22Scene::~Scene() = default;
23
24void Scene::render(SkCanvas* canvas) const {
25 fRoot->render(canvas);
26}
27
29 fRoot->revalidate(ic, SkMatrix::I());
30}
31
32const RenderNode* Scene::nodeAt(const SkPoint& p) const {
33 return fRoot->nodeAt(p);
34}
35
36} // namespace sksg
static const SkMatrix & I()
const RenderNode * nodeAt(const SkPoint &) const
Definition SkSGScene.cpp:32
Scene(const Scene &)=delete
void revalidate(InvalidationController *=nullptr)
Definition SkSGScene.cpp:28
static std::unique_ptr< Scene > Make(sk_sp< RenderNode > root)
Definition SkSGScene.cpp:16
void render(SkCanvas *) const
Definition SkSGScene.cpp:24
Definition Skottie.h:32
Definition ref_ptr.h:256