You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
954 B
49 lines
954 B
4 months ago
|
/*
|
||
|
* Copyright 2018 Google Inc.
|
||
|
*
|
||
|
* Use of this source code is governed by a BSD-style license that can be
|
||
|
* found in the LICENSE file.
|
||
|
*/
|
||
|
|
||
|
#ifndef SkSGScene_DEFINED
|
||
|
#define SkSGScene_DEFINED
|
||
|
|
||
|
#include "include/core/SkRefCnt.h"
|
||
|
#include "include/core/SkTypes.h"
|
||
|
|
||
|
#include <memory>
|
||
|
#include <vector>
|
||
|
|
||
|
class SkCanvas;
|
||
|
struct SkPoint;
|
||
|
|
||
|
namespace sksg {
|
||
|
|
||
|
class InvalidationController;
|
||
|
class RenderNode;
|
||
|
|
||
|
/**
|
||
|
* Holds a scene root. Provides high-level methods for rendering.
|
||
|
*
|
||
|
*/
|
||
|
class Scene final {
|
||
|
public:
|
||
|
static std::unique_ptr<Scene> Make(sk_sp<RenderNode> root);
|
||
|
~Scene();
|
||
|
Scene(const Scene&) = delete;
|
||
|
Scene& operator=(const Scene&) = delete;
|
||
|
|
||
|
void render(SkCanvas*) const;
|
||
|
void revalidate(InvalidationController* = nullptr);
|
||
|
const RenderNode* nodeAt(const SkPoint&) const;
|
||
|
|
||
|
private:
|
||
|
explicit Scene(sk_sp<RenderNode> root);
|
||
|
|
||
|
const sk_sp<RenderNode> fRoot;
|
||
|
};
|
||
|
|
||
|
} // namespace sksg
|
||
|
|
||
|
#endif // SkSGScene_DEFINED
|