scene.h 1.1 KB
Newer Older
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
#ifndef FLUTTER_LIB_UI_COMPOSITING_SCENE_H_
#define FLUTTER_LIB_UI_COMPOSITING_SCENE_H_
7

8
#include <stdint.h>
9 10
#include <memory>

11
#include "base/memory/ref_counted.h"
A
Adam Barth 已提交
12
#include "flow/layers/layer_tree.h"
13
#include "flutter/tonic/dart_wrappable.h"
14 15 16
#include "third_party/skia/include/core/SkPicture.h"

namespace blink {
17
class DartLibraryNatives;
18

19
class Scene : public base::RefCountedThreadSafe<Scene>, public DartWrappable {
20
  DEFINE_WRAPPERTYPEINFO();
21

22 23
 public:
  ~Scene() override;
24
  static scoped_refptr<Scene> create(
A
Adam Barth 已提交
25
      std::unique_ptr<flow::Layer> rootLayer,
26
      uint32_t rasterizerTracingThreshold);
27

A
Adam Barth 已提交
28
  std::unique_ptr<flow::LayerTree> takeLayerTree();
29

30 31
  void dispose();

32 33
  static void RegisterNatives(DartLibraryNatives* natives);

34
 private:
A
Adam Barth 已提交
35
  explicit Scene(std::unique_ptr<flow::Layer> rootLayer,
36
                 uint32_t rasterizerTracingThreshold);
37

A
Adam Barth 已提交
38
  std::unique_ptr<flow::LayerTree> m_layerTree;
39 40
};

41
}  // namespace blink
42

43
#endif  // FLUTTER_LIB_UI_COMPOSITING_SCENE_H_