Flutter Engine
The Flutter Engine
scene.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_LIB_UI_COMPOSITING_SCENE_H_
6#define FLUTTER_LIB_UI_COMPOSITING_SCENE_H_
7
8#include <cstdint>
9#include <memory>
10
11#include "flutter/flow/layers/layer_tree.h"
12#include "flutter/lib/ui/dart_wrapper.h"
13
14namespace flutter {
15
16class Scene : public RefCountedDartWrappable<Scene> {
17 DEFINE_WRAPPERTYPEINFO();
18 FML_FRIEND_MAKE_REF_COUNTED(Scene);
19
20 public:
21 ~Scene() override;
22 static void create(Dart_Handle scene_handle,
23 std::shared_ptr<flutter::Layer> rootLayer);
24
25 std::unique_ptr<flutter::LayerTree> takeLayerTree(uint64_t width,
26 uint64_t height);
27
29 uint32_t height,
30 Dart_Handle raw_image_handle);
31
32 Dart_Handle toImage(uint32_t width,
33 uint32_t height,
34 Dart_Handle raw_image_handle);
35
36 void dispose();
37
38 private:
39 explicit Scene(std::shared_ptr<flutter::Layer> rootLayer);
40
41 // Returns true if `dispose()` has not been called.
42 bool valid();
43
44 void RasterizeToImage(uint32_t width,
45 uint32_t height,
46 Dart_Handle raw_image_handle);
47
48 std::unique_ptr<LayerTree> BuildLayerTree(uint32_t width, uint32_t height);
49
50 std::shared_ptr<Layer> layer_tree_root_layer_;
51};
52
53} // namespace flutter
54
55#endif // FLUTTER_LIB_UI_COMPOSITING_SCENE_H_
std::unique_ptr< flutter::LayerTree > takeLayerTree(uint64_t width, uint64_t height)
Definition: scene.cc:122
Dart_Handle toImage(uint32_t width, uint32_t height, Dart_Handle raw_image_handle)
Definition: scene.cc:61
void dispose()
Definition: scene.cc:43
static void create(Dart_Handle scene_handle, std::shared_ptr< flutter::Layer > rootLayer)
Definition: scene.cc:27
~Scene() override
Definition: scene.cc:37
Dart_Handle toImageSync(uint32_t width, uint32_t height, Dart_Handle raw_image_handle)
Definition: scene.cc:48
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
int32_t height
int32_t width