Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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();
19
20 public:
21 ~Scene() override;
22 static void create(Dart_Handle scene_handle,
23 std::shared_ptr<flutter::Layer> rootLayer,
24 uint32_t rasterizerTracingThreshold,
25 bool checkerboardRasterCacheImages,
26 bool checkerboardOffscreenLayers);
27
28 std::unique_ptr<flutter::LayerTree> takeLayerTree(uint64_t width,
29 uint64_t height);
30
32 uint32_t height,
33 Dart_Handle raw_image_handle);
34
35 Dart_Handle toImage(uint32_t width,
36 uint32_t height,
37 Dart_Handle raw_image_handle);
38
39 void dispose();
40
41 private:
42 Scene(std::shared_ptr<flutter::Layer> rootLayer,
43 uint32_t rasterizerTracingThreshold,
44 bool checkerboardRasterCacheImages,
45 bool checkerboardOffscreenLayers);
46
47 // Returns true if `dispose()` has not been called.
48 bool valid();
49
50 void RasterizeToImage(uint32_t width,
51 uint32_t height,
52 Dart_Handle raw_image_handle);
53
54 std::unique_ptr<LayerTree> BuildLayerTree(uint32_t width, uint32_t height);
55
56 flutter::LayerTree::Config layer_tree_config_;
57};
58
59} // namespace flutter
60
61#endif // FLUTTER_LIB_UI_COMPOSITING_SCENE_H_
std::unique_ptr< flutter::LayerTree > takeLayerTree(uint64_t width, uint64_t height)
Definition scene.cc:130
Dart_Handle toImage(uint32_t width, uint32_t height, Dart_Handle raw_image_handle)
Definition scene.cc:74
void dispose()
Definition scene.cc:56
~Scene() override
Definition scene.cc:50
Dart_Handle toImageSync(uint32_t width, uint32_t height, Dart_Handle raw_image_handle)
Definition scene.cc:61
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
#define FML_FRIEND_MAKE_REF_COUNTED(T)
int32_t height
int32_t width