12 double device_pixel_ratio,
13 DlMatrix root_surface_transformation,
14 uint64_t presentation_time)
15 : frame_size_(frame_size),
16 device_pixel_ratio_(device_pixel_ratio),
17 root_surface_transformation_(root_surface_transformation),
18 presentation_time_(presentation_time) {}
24 const std::vector<DlIRect>& paint_region_vec) {
33 const auto transformed_layer_bounds =
34 layer_bounds.TransformAndClipBounds(root_surface_transformation_);
36 layer.
offset.
x = transformed_layer_bounds.GetX();
37 layer.
offset.
y = transformed_layer_bounds.GetY();
38 layer.
size.
width = transformed_layer_bounds.GetWidth();
39 layer.
size.
height = transformed_layer_bounds.GetHeight();
41 auto paint_region_rects = std::make_unique<std::vector<FlutterRect>>();
42 paint_region_rects->reserve(paint_region_vec.size());
44 for (
const auto& rect : paint_region_vec) {
45 auto transformed_rect =
46 DlRect::Make(rect).TransformAndClipBounds(root_surface_transformation_);
48 .
left = transformed_rect.GetLeft(),
49 .top = transformed_rect.GetTop(),
50 .right = transformed_rect.GetRight(),
51 .bottom = transformed_rect.GetBottom(),
55 auto paint_region = std::make_unique<FlutterRegion>();
57 paint_region->rects = paint_region_rects->data();
58 paint_region->rects_count = paint_region_rects->size();
59 rects_referenced_.push_back(std::move(paint_region_rects));
61 auto present_info = std::make_unique<FlutterBackingStorePresentInfo>();
63 present_info->paint_region = paint_region.get();
64 regions_referenced_.push_back(std::move(paint_region));
68 present_info_referenced_.push_back(std::move(present_info));
69 presented_layers_.push_back(layer);
77 return std::make_unique<FlutterPlatformViewMutation>(mutation);
88 return std::make_unique<FlutterPlatformViewMutation>(mutation);
107 const auto& radii = rrect.
GetRadii();
116 return std::make_unique<FlutterPlatformViewMutation>(mutation);
132 return std::make_unique<FlutterPlatformViewMutation>(mutation);
141 view.identifier = identifier;
143 const auto& mutators =
params.mutatorsStack();
145 std::vector<const FlutterPlatformViewMutation*> mutations_array;
147 for (
auto i = mutators.Bottom();
i != mutators.Top(); ++
i) {
148 const auto& mutator = *
i;
149 switch (mutator->GetType()) {
151 mutations_array.push_back(
152 mutations_referenced_
157 mutations_array.push_back(
158 mutations_referenced_
163 mutations_array.push_back(
164 mutations_referenced_
172 const auto& matrix = mutator->GetMatrix();
173 if (!matrix.IsIdentity()) {
174 mutations_array.push_back(
180 const double opacity =
181 std::clamp(mutator->GetAlphaFloat(), 0.0f, 1.0f);
183 mutations_array.push_back(
193 if (!mutations_array.empty()) {
196 if (!root_surface_transformation_.
IsIdentity()) {
197 mutations_array.push_back(
198 mutations_referenced_
204 std::make_unique<std::vector<const FlutterPlatformViewMutation*>>(
205 mutations_array.rbegin(), mutations_array.rend());
206 mutations_arrays_referenced_.emplace_back(std::move(mutations));
208 view.mutations_count = mutations_array.size();
209 view.mutations = mutations_arrays_referenced_.back().get()->data();
212 platform_views_referenced_.emplace_back(
213 std::make_unique<FlutterPlatformView>(
view));
220 layer.
platform_view = platform_views_referenced_.back().get();
222 const auto layer_bounds =
224 params.finalBoundingRect().GetY(),
225 params.sizePoints().width * device_pixel_ratio_,
226 params.sizePoints().height * device_pixel_ratio_
229 const auto transformed_layer_bounds =
230 layer_bounds.TransformAndClipBounds(root_surface_transformation_);
232 layer.
offset.
x = transformed_layer_bounds.GetX();
233 layer.
offset.
y = transformed_layer_bounds.GetY();
234 layer.
size.
width = transformed_layer_bounds.GetWidth();
235 layer.
size.
height = transformed_layer_bounds.GetHeight();
239 presented_layers_.push_back(layer);
245 std::vector<const FlutterLayer*> presented_layers_pointers;
246 presented_layers_pointers.reserve(presented_layers_.size());
247 for (
const auto& layer : presented_layers_) {
248 presented_layers_pointers.push_back(&layer);
void PushPlatformViewLayer(FlutterPlatformViewIdentifier identifier, const EmbeddedViewParams ¶ms)
EmbedderLayers(DlISize frame_size, double device_pixel_ratio, DlMatrix root_surface_transformation, uint64_t presentation_time)
void InvokePresentCallback(FlutterViewId view_id, const PresentCallback &callback) const
void PushBackingStoreLayer(const FlutterBackingStore *store, const std::vector< DlIRect > &drawn_region)
std::function< bool(FlutterViewId view_id, const std::vector< const FlutterLayer * > &layers)> PresentCallback
int64_t FlutterPlatformViewIdentifier
@ kFlutterLayerContentTypePlatformView
Indicates that the contents of this layer are determined by the embedder.
@ kFlutterLayerContentTypeBackingStore
@ kFlutterPlatformViewMutationTypeClipRoundedRect
@ kFlutterPlatformViewMutationTypeClipRect
@ kFlutterPlatformViewMutationTypeTransformation
@ kFlutterPlatformViewMutationTypeOpacity
const EmbeddedViewParams * params
G_BEGIN_DECLS FlutterViewId view_id
FlutterDesktopBinaryReply callback
static FlutterSize ConvertSize(const DlSize &vector)
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
static std::unique_ptr< FlutterPlatformViewMutation > ConvertMutation(double opacity)
FlutterLayerContentType type
const FlutterBackingStore * backing_store
FlutterBackingStorePresentInfo * backing_store_present_info
uint64_t presentation_time
const FlutterPlatformView * platform_view
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
FlutterSize size
The size of the layer (in physical pixels).
A structure to represent a rectangle.
A region represented by a collection of non-overlapping rectangles.
FlutterSize upper_left_corner_radius
FlutterSize lower_left_corner_radius
FlutterSize upper_right_corner_radius
FlutterSize lower_right_corner_radius
A structure to represent the width and height.
A 4x4 matrix using column-major storage.
constexpr bool IsIdentity() const
constexpr const RoundingRadii & GetRadii() const
constexpr const Rect & GetBounds() const
constexpr auto GetBottom() const
constexpr auto GetTop() const
static constexpr std::enable_if_t< std::is_floating_point_v< FT >, TRect > Make(const TRect< U > &rect)
constexpr auto GetLeft() const
constexpr auto GetRight() const
static constexpr TRect MakeXYWH(Type x, Type y, Type width, Type height)
static constexpr TRect MakeSize(const TSize< U > &size)