Composites Flutter UI and overlay layers alongside embedded UIViews. More...
#include <platform_views_controller.h>
Public Member Functions | |
PlatformViewsController () | |
~PlatformViewsController ()=default | |
fml::WeakPtr< flutter::PlatformViewsController > | GetWeakPtr () |
Retrieve a weak pointer to this controller. More... | |
void | SetTaskRunner (const fml::RefPtr< fml::TaskRunner > &platform_task_runner) |
Set the platform task runner used to post rendering tasks. More... | |
void | SetFlutterView (UIView *flutter_view) __attribute__((cf_audited_transfer)) |
Set the flutter view. More... | |
void | SetFlutterViewController (UIViewController< FlutterViewResponder > *flutter_view_controller) __attribute__((cf_audited_transfer)) |
Set the flutter view controller. More... | |
UIViewController< FlutterViewResponder > * | GetFlutterViewController () __attribute__((cf_audited_transfer)) |
Retrieve the view controller. More... | |
void | RegisterViewFactory (NSObject< FlutterPlatformViewFactory > *factory, NSString *factoryId, FlutterPlatformViewGestureRecognizersBlockingPolicy gestureRecognizerBlockingPolicy) __attribute__((cf_audited_transfer)) |
set the factory used to construct embedded UI Views. More... | |
void | BeginFrame (SkISize frame_size) |
Mark the beginning of a frame and record the size of the onscreen. More... | |
void | CancelFrame () |
Cancel the current frame, indicating that no platform views are composited. More... | |
void | PrerollCompositeEmbeddedView (int64_t view_id, std::unique_ptr< flutter::EmbeddedViewParams > params) |
Record a platform view in the layer tree to be rendered, along with the positioning and mutator parameters. More... | |
FlutterTouchInterceptingView * | GetFlutterTouchInterceptingViewByID (int64_t view_id) |
Returns theFlutterTouchInterceptingView with the provided view_id. More... | |
PostPrerollResult | PostPrerollAction (const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger, bool impeller_enabled) |
Determine if thread merging is required after prerolling platform views. More... | |
void | EndFrame (bool should_resubmit_frame, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger, bool impeller_enabled) |
Mark the end of a compositor frame. More... | |
DlCanvas * | CompositeEmbeddedView (int64_t view_id) |
Returns the Canvas for the overlay slice for the given platform view. More... | |
void | Reset () |
Discards all platform views instances and auxiliary resources. More... | |
bool | SubmitFrame (GrDirectContext *gr_context, const std::shared_ptr< IOSContext > &ios_context, std::unique_ptr< SurfaceFrame > frame) |
Encode rendering for the Flutter overlay views and queue up perform platform view mutations. More... | |
void | OnMethodCall (FlutterMethodCall *call, FlutterResult result) __attribute__((cf_audited_transfer)) |
Handler for platform view message channels. More... | |
long | FindFirstResponderPlatformViewId () |
Returns the platform view id if the platform view (or any of its descendant view) is the first responder. More... | |
void | PushFilterToVisitedPlatformViews (const std::shared_ptr< const DlImageFilter > &filter, const SkRect &filter_rect) |
Pushes backdrop filter mutation to the mutator stack of each visited platform view. More... | |
void | PushVisitedPlatformView (int64_t view_id) |
Pushes the view id of a visted platform view to the list of visied platform views. More... | |
size_t | EmbeddedViewCount () const |
size_t | LayerPoolSize () const |
UIView * | GetPlatformViewByID (int64_t view_id) |
void | CompositeWithParams (int64_t view_id, const EmbeddedViewParams ¶ms) |
const EmbeddedViewParams & | GetCompositionParams (int64_t view_id) const |
Composites Flutter UI and overlay layers alongside embedded UIViews.
Definition at line 31 of file platform_views_controller.h.
flutter::PlatformViewsController::PlatformViewsController | ( | ) |
Definition at line 113 of file platform_views_controller.mm.
|
default |
void flutter::PlatformViewsController::BeginFrame | ( | SkISize | frame_size | ) |
Mark the beginning of a frame and record the size of the onscreen.
Definition at line 282 of file platform_views_controller.mm.
void flutter::PlatformViewsController::CancelFrame | ( | ) |
Cancel the current frame, indicating that no platform views are composited.
Additionally, reverts the composition order to its original state at the beginning of the frame.
Definition at line 287 of file platform_views_controller.mm.
Referenced by PostPrerollAction().
DlCanvas * flutter::PlatformViewsController::CompositeEmbeddedView | ( | int64_t | view_id | ) |
Returns the Canvas for the overlay slice for the given platform view.
Called from the raster thread.
Definition at line 579 of file platform_views_controller.mm.
void flutter::PlatformViewsController::CompositeWithParams | ( | int64_t | view_id, |
const EmbeddedViewParams & | params | ||
) |
Definition at line 540 of file platform_views_controller.mm.
size_t flutter::PlatformViewsController::EmbeddedViewCount | ( | ) | const |
Definition at line 369 of file platform_views_controller.mm.
void flutter::PlatformViewsController::EndFrame | ( | bool | should_resubmit_frame, |
const fml::RefPtr< fml::RasterThreadMerger > & | raster_thread_merger, | ||
bool | impeller_enabled | ||
) |
Mark the end of a compositor frame.
May determine changes are required to the thread merging state. Called from the raster thread.
Definition at line 326 of file platform_views_controller.mm.
long flutter::PlatformViewsController::FindFirstResponderPlatformViewId | ( | ) |
Returns the platform view id if the platform view (or any of its descendant view) is the first responder.
Returns -1 if no such platform view is found.
Definition at line 389 of file platform_views_controller.mm.
|
inline |
Definition at line 151 of file platform_views_controller.h.
FlutterTouchInterceptingView * flutter::PlatformViewsController::GetFlutterTouchInterceptingViewByID | ( | int64_t | view_id | ) |
Returns theFlutterTouchInterceptingView
with the provided view_id.
Returns nil if there is no platform view with the provided id. Called from the platform thread.
Definition at line 381 of file platform_views_controller.mm.
Referenced by GetPlatformViewByID().
UIViewController< FlutterViewResponder > * flutter::PlatformViewsController::GetFlutterViewController | ( | ) |
Retrieve the view controller.
Definition at line 138 of file platform_views_controller.mm.
UIView * flutter::PlatformViewsController::GetPlatformViewByID | ( | int64_t | view_id | ) |
Definition at line 377 of file platform_views_controller.mm.
References GetFlutterTouchInterceptingViewByID().
fml::WeakPtr< flutter::PlatformViewsController > flutter::PlatformViewsController::GetWeakPtr | ( | ) |
Retrieve a weak pointer to this controller.
Definition at line 125 of file platform_views_controller.mm.
size_t flutter::PlatformViewsController::LayerPoolSize | ( | ) | const |
Definition at line 373 of file platform_views_controller.mm.
void flutter::PlatformViewsController::OnMethodCall | ( | FlutterMethodCall * | call, |
FlutterResult | result | ||
) |
Handler for platform view message channels.
Definition at line 142 of file platform_views_controller.mm.
References FlutterMethodNotImplemented.
PostPrerollResult flutter::PlatformViewsController::PostPrerollAction | ( | const fml::RefPtr< fml::RasterThreadMerger > & | raster_thread_merger, |
bool | impeller_enabled | ||
) |
Determine if thread merging is required after prerolling platform views.
Called from the raster thread.
Definition at line 291 of file platform_views_controller.mm.
References CancelFrame().
void flutter::PlatformViewsController::PrerollCompositeEmbeddedView | ( | int64_t | view_id, |
std::unique_ptr< flutter::EmbeddedViewParams > | params | ||
) |
Record a platform view in the layer tree to be rendered, along with the positioning and mutator parameters.
Called from the raster thread.
Definition at line 350 of file platform_views_controller.mm.
void flutter::PlatformViewsController::PushFilterToVisitedPlatformViews | ( | const std::shared_ptr< const DlImageFilter > & | filter, |
const SkRect & | filter_rect | ||
) |
Pushes backdrop filter mutation to the mutator stack of each visited platform view.
Definition at line 340 of file platform_views_controller.mm.
|
inline |
Pushes the view id of a visted platform view to the list of visied platform views.
Definition at line 131 of file platform_views_controller.h.
void flutter::PlatformViewsController::RegisterViewFactory | ( | NSObject< FlutterPlatformViewFactory > * | factory, |
NSString * | factoryId, | ||
FlutterPlatformViewGestureRecognizersBlockingPolicy | gestureRecognizerBlockingPolicy | ||
) |
set the factory used to construct embedded UI Views.
Definition at line 272 of file platform_views_controller.mm.
void flutter::PlatformViewsController::Reset | ( | ) |
Discards all platform views instances and auxiliary resources.
Called from the raster thread.
Definition at line 583 of file platform_views_controller.mm.
void flutter::PlatformViewsController::SetFlutterView | ( | UIView * | flutter_view | ) |
Set the flutter view.
Definition at line 129 of file platform_views_controller.mm.
void flutter::PlatformViewsController::SetFlutterViewController | ( | UIViewController< FlutterViewResponder > * | flutter_view_controller | ) |
Set the flutter view controller.
Definition at line 133 of file platform_views_controller.mm.
void flutter::PlatformViewsController::SetTaskRunner | ( | const fml::RefPtr< fml::TaskRunner > & | platform_task_runner | ) |
Set the platform task runner used to post rendering tasks.
Definition at line 120 of file platform_views_controller.mm.
bool flutter::PlatformViewsController::SubmitFrame | ( | GrDirectContext * | gr_context, |
const std::shared_ptr< IOSContext > & | ios_context, | ||
std::unique_ptr< SurfaceFrame > | frame | ||
) |
Encode rendering for the Flutter overlay views and queue up perform platform view mutations.
Called from the raster thread.
Definition at line 603 of file platform_views_controller.mm.