#include <FlutterCompositor.h>
Definition at line 36 of file FlutterCompositor.h.
◆ FlutterCompositor()
Definition at line 35 of file FlutterCompositor.mm.
38 : view_provider_(view_provider),
39 time_converter_(time_converter),
40 platform_view_controller_(platform_view_controller) {
41 FML_CHECK(view_provider !=
nullptr) <<
"view_provider cannot be nullptr";
◆ ~FlutterCompositor()
| flutter::FlutterCompositor::~FlutterCompositor |
( |
| ) |
|
|
default |
◆ CreateBackingStore()
| bool flutter::FlutterCompositor::CreateBackingStore |
( |
const FlutterBackingStoreConfig * |
config, |
|
|
FlutterBackingStore * |
backing_store_out |
|
) |
| |
Definition at line 44 of file FlutterCompositor.mm.
49 FlutterView* view = [view_provider_ viewForIdentifier:kFlutterImplicitViewId];
54 CGSize size = CGSizeMake(config->size.width, config->size.height);
56 memset(backing_store_out, 0,
sizeof(FlutterBackingStore));
57 backing_store_out->struct_size =
sizeof(FlutterBackingStore);
58 backing_store_out->type = kFlutterBackingStoreTypeMetal;
59 backing_store_out->metal.struct_size =
sizeof(FlutterMetalBackingStore);
References FlutterSurface::asFlutterMetalTexture, and FlutterView::surfaceManager.
◆ Present()
| bool flutter::FlutterCompositor::Present |
( |
FlutterViewIdentifier |
view_id, |
|
|
const FlutterLayer ** |
layers, |
|
|
size_t |
layers_count |
|
) |
| |
Definition at line 64 of file FlutterCompositor.mm.
67 FlutterView* view = [view_provider_ viewForIdentifier:view_id];
72 NSMutableArray* surfaces = [NSMutableArray array];
73 for (
size_t i = 0; i < layers_count; i++) {
74 const FlutterLayer* layer = layers[i];
75 if (layer->type == kFlutterLayerContentTypeBackingStore) {
77 [
FlutterSurface fromFlutterMetalTexture:&layer->backing_store->metal.texture];
82 info.
offset = CGPointMake(layer->offset.x, layer->offset.y);
84 FlutterBackingStorePresentInfo* present_info = layer->backing_store_present_info;
85 if (present_info !=
nullptr && present_info->paint_region !=
nullptr) {
86 auto paint_region = present_info->paint_region;
89 paint_region->rects, paint_region->rects + paint_region->rects_count);
91 [surfaces addObject:info];
96 CFTimeInterval presentation_time = 0;
98 if (layers_count > 0 && layers[0]->presentation_time != 0) {
99 presentation_time = [time_converter_ engineTimeToCAMediaTime:layers[0]->presentation_time];
104 auto layers_copy = std::make_shared<std::vector<LayerVariant>>(CopyLayers(layers, layers_count));
107 presentSurfaces:surfaces
108 atTime:presentation_time
111 ViewPresenter& presenter = presenters_[view_id];
112 presenter.PresentPlatformViews(view, *layers_copy, platform_view_controller_);
References FlutterSurfacePresentInfo::offset, FlutterSurfacePresentInfo::paintRegion, FlutterSurfacePresentInfo::surface, FlutterView::surfaceManager, and FlutterSurfacePresentInfo::zIndex.
The documentation for this class was generated from the following files: