Flutter Engine
 
Loading...
Searching...
No Matches
scene_builder.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_BUILDER_H_
6#define FLUTTER_LIB_UI_COMPOSITING_SCENE_BUILDER_H_
7
8#include <cstdint>
9#include <memory>
10#include <vector>
11
23
24namespace flutter {
25
26class SceneBuilder : public RefCountedDartWrappable<SceneBuilder> {
27 DEFINE_WRAPPERTYPEINFO();
29
30 public:
31 static void Create(Dart_Handle wrapper) {
33 auto res = fml::MakeRefCounted<SceneBuilder>();
34 res->AssociateWithDartWrapper(wrapper);
35 }
36
37 ~SceneBuilder() override;
38
39 void pushTransformHandle(Dart_Handle layer_handle,
40 Dart_Handle matrix4_handle,
41 const fml::RefPtr<EngineLayer>& old_layer) {
42 tonic::Float64List matrix4(matrix4_handle);
43 pushTransform(layer_handle, matrix4, old_layer);
44 }
45 void pushTransform(Dart_Handle layer_handle,
46 tonic::Float64List& matrix4,
47 const fml::RefPtr<EngineLayer>& old_layer);
48 void pushOffset(Dart_Handle layer_handle,
49 double dx,
50 double dy,
51 const fml::RefPtr<EngineLayer>& old_layer);
52 void pushClipRect(Dart_Handle layer_handle,
53 double left,
54 double right,
55 double top,
56 double bottom,
57 int clip_behavior,
58 const fml::RefPtr<EngineLayer>& old_layer);
59 void pushClipRRect(Dart_Handle layer_handle,
60 const RRect& rrect,
61 int clip_behavior,
62 const fml::RefPtr<EngineLayer>& old_layer);
63 void pushClipRSuperellipse(Dart_Handle layer_handle,
64 const RSuperellipse* rse,
65 int clip_behavior,
66 const fml::RefPtr<EngineLayer>& old_layer);
67 void pushClipPath(Dart_Handle layer_handle,
68 const CanvasPath* path,
69 int clip_behavior,
70 const fml::RefPtr<EngineLayer>& old_layer);
71 void pushOpacity(Dart_Handle layer_handle,
72 int alpha,
73 double dx,
74 double dy,
75 const fml::RefPtr<EngineLayer>& old_layer);
76 void pushColorFilter(Dart_Handle layer_handle,
77 const ColorFilter* color_filter,
78 const fml::RefPtr<EngineLayer>& old_layer);
79 void pushImageFilter(Dart_Handle layer_handle,
80 const ImageFilter* image_filter,
81 double dx,
82 double dy,
83 const fml::RefPtr<EngineLayer>& old_layer);
84 void pushBackdropFilter(Dart_Handle layer_handle,
85 ImageFilter* filter,
86 int blend_mode,
87 Dart_Handle backdrop_id,
88 const fml::RefPtr<EngineLayer>& old_layer);
89 void pushShaderMask(Dart_Handle layer_handle,
90 Shader* shader,
91 double mask_rect_left,
92 double mask_rect_right,
93 double mask_rect_top,
94 double mask_rect_bottom,
95 int blend_mode,
96 int filter_quality_index,
97 const fml::RefPtr<EngineLayer>& old_layer);
98
99 void addRetained(const fml::RefPtr<EngineLayer>& retained_layer);
100
101 void pop();
102
103 void addPerformanceOverlay(uint64_t enabled_options,
104 double left,
105 double right,
106 double top,
107 double bottom);
108
109 void addPicture(double dx, double dy, Picture* picture, int hints);
110
111 void addTexture(double dx,
112 double dy,
113 double width,
114 double height,
115 int64_t texture_id,
116 bool freeze,
117 int filter_quality);
118
119 void addPlatformView(double dx,
120 double dy,
121 double width,
122 double height,
123 int64_t view_id);
124
125 void build(Dart_Handle scene_handle);
126
127 const std::vector<std::shared_ptr<ContainerLayer>>& layer_stack() {
128 return layer_stack_;
129 }
130
131 private:
132 SceneBuilder();
133
134 void AddLayer(std::shared_ptr<Layer> layer);
135 void PushLayer(std::shared_ptr<ContainerLayer> layer);
136 void PopLayer();
137
138 std::vector<std::shared_ptr<ContainerLayer>> layer_stack_;
139
141};
142
143} // namespace flutter
144
145#endif // FLUTTER_LIB_UI_COMPOSITING_SCENE_BUILDER_H_
void pushOffset(Dart_Handle layer_handle, double dx, double dy, const fml::RefPtr< EngineLayer > &old_layer)
~SceneBuilder() override
void pushClipPath(Dart_Handle layer_handle, const CanvasPath *path, int clip_behavior, const fml::RefPtr< EngineLayer > &old_layer)
const std::vector< std::shared_ptr< ContainerLayer > > & layer_stack()
static void Create(Dart_Handle wrapper)
void pushTransform(Dart_Handle layer_handle, tonic::Float64List &matrix4, const fml::RefPtr< EngineLayer > &old_layer)
void pushColorFilter(Dart_Handle layer_handle, const ColorFilter *color_filter, const fml::RefPtr< EngineLayer > &old_layer)
void pushBackdropFilter(Dart_Handle layer_handle, ImageFilter *filter, int blend_mode, Dart_Handle backdrop_id, const fml::RefPtr< EngineLayer > &old_layer)
void pushClipRSuperellipse(Dart_Handle layer_handle, const RSuperellipse *rse, int clip_behavior, const fml::RefPtr< EngineLayer > &old_layer)
void pushTransformHandle(Dart_Handle layer_handle, Dart_Handle matrix4_handle, const fml::RefPtr< EngineLayer > &old_layer)
void addRetained(const fml::RefPtr< EngineLayer > &retained_layer)
void addTexture(double dx, double dy, double width, double height, int64_t texture_id, bool freeze, int filter_quality)
void pushShaderMask(Dart_Handle layer_handle, Shader *shader, double mask_rect_left, double mask_rect_right, double mask_rect_top, double mask_rect_bottom, int blend_mode, int filter_quality_index, const fml::RefPtr< EngineLayer > &old_layer)
void addPerformanceOverlay(uint64_t enabled_options, double left, double right, double top, double bottom)
void pushClipRRect(Dart_Handle layer_handle, const RRect &rrect, int clip_behavior, const fml::RefPtr< EngineLayer > &old_layer)
void pushClipRect(Dart_Handle layer_handle, double left, double right, double top, double bottom, int clip_behavior, const fml::RefPtr< EngineLayer > &old_layer)
void addPicture(double dx, double dy, Picture *picture, int hints)
void pushOpacity(Dart_Handle layer_handle, int alpha, double dx, double dy, const fml::RefPtr< EngineLayer > &old_layer)
void pushImageFilter(Dart_Handle layer_handle, const ImageFilter *image_filter, double dx, double dy, const fml::RefPtr< EngineLayer > &old_layer)
void addPlatformView(double dx, double dy, double width, double height, int64_t view_id)
static void ThrowIfUIOperationsProhibited()
G_BEGIN_DECLS FlutterViewId view_id
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switch_defs.h:52
#define FML_FRIEND_MAKE_REF_COUNTED(T)
int32_t height
int32_t width
int64_t texture_id