pub struct RendererBinding { /* private fields */ }Implementations§
Source§impl RendererBinding
impl RendererBinding
Sourcepub fn instance(app: &mut App) -> Handle<RendererBinding>
pub fn instance(app: &mut App) -> Handle<RendererBinding>
The current binding, initialized on first access (Flutter’s initInstances).
Sourcepub fn mouse_tracker(self: Handle<Self>, app: &App) -> Handle<MouseTracker>
pub fn mouse_tracker(self: Handle<Self>, app: &App) -> Handle<MouseTracker>
The object that manages state about currently connected mice, for hover notification.
Sourcepub fn init_mouse_tracker(
self: Handle<Self>,
app: &mut App,
tracker: Option<Handle<MouseTracker>>,
)
pub fn init_mouse_tracker( self: Handle<Self>, app: &mut App, tracker: Option<Handle<MouseTracker>>, )
Creates a MouseTracker which manages state about currently connected
mice, for hover notification.
Used by testing framework to reinitialize the mouse tracker between tests.
Sourcepub fn root_pipeline_owner(
self: Handle<Self>,
app: &App,
) -> Handle<PipelineOwner>
pub fn root_pipeline_owner( self: Handle<Self>, app: &App, ) -> Handle<PipelineOwner>
The PipelineOwner that is the root of the pipeline owner tree.
Typically, this owner has no root render object (a RenderView is attached to the
owners the widget layer adds as children). A test that renders without widgets attaches
its view’s here, through init_render_view.
Sourcepub fn render_views(
self: Handle<Self>,
app: &App,
) -> Vec<RenderHandle<RenderView>>
pub fn render_views( self: Handle<Self>, app: &App, ) -> Vec<RenderHandle<RenderView>>
The RenderViews managed by this binding.
Sourcepub fn add_render_view(
self: Handle<Self>,
app: &mut App,
view: RenderHandle<RenderView>,
)
pub fn add_render_view( self: Handle<Self>, app: &mut App, view: RenderHandle<RenderView>, )
Adds a RenderView to this binding.
The binding will interact with the RenderView in the following ways:
- setting and updating
RenderView::configuration, - calling
RenderView::composite_framewhen it is time to produce a new frame.
Sourcepub fn remove_render_view(
self: Handle<Self>,
app: &mut App,
view: RenderHandle<RenderView>,
)
pub fn remove_render_view( self: Handle<Self>, app: &mut App, view: RenderHandle<RenderView>, )
Removes a RenderView previously added with add_render_view.
Sourcepub fn create_view_configuration_for(
self: Handle<Self>,
app: &App,
render_view: RenderHandle<RenderView>,
) -> ViewConfiguration
pub fn create_view_configuration_for( self: Handle<Self>, app: &App, render_view: RenderHandle<RenderView>, ) -> ViewConfiguration
Returns a ViewConfiguration configured for the provided RenderView based on
the current environment.
Sourcepub fn handle_mark_all_views_need_render(self: Handle<Self>, app: &mut App)
pub fn handle_mark_all_views_need_render(self: Handle<Self>, app: &mut App)
Marks all views to require compositing, which will force them to re-render on their next frame.
Sourcepub fn handle_metrics_changed(self: Handle<Self>, app: &mut App)
pub fn handle_metrics_changed(self: Handle<Self>, app: &mut App)
Called when the system metrics change.
See View::metrics.
Sourcepub fn send_frames_to_engine(self: Handle<Self>, app: &App) -> bool
pub fn send_frames_to_engine(self: Handle<Self>, app: &App) -> bool
Whether frames produced by draw_frame are sent to the host.
If false the framework will do all the work to produce a frame, but the frame is never sent to the host to actually appear on screen.
Sourcepub fn defer_first_frame(self: Handle<Self>, app: &mut App)
pub fn defer_first_frame(self: Handle<Self>, app: &mut App)
Tell the framework to not send the first frames to the host until there is a
corresponding call to allow_first_frame.
Sourcepub fn allow_first_frame(self: Handle<Self>, app: &mut App)
pub fn allow_first_frame(self: Handle<Self>, app: &mut App)
Called after defer_first_frame to tell the framework that it
is ok to send the first frame to the host now.
Sourcepub fn reset_first_frame_sent(self: Handle<Self>, app: &mut App)
pub fn reset_first_frame_sent(self: Handle<Self>, app: &mut App)
Call this to pretend that no frames have been sent to the host yet.
Sourcepub fn set_overrides(
self: Handle<Self>,
app: &mut App,
overrides: Rc<dyn RendererBindingOverrides>,
)
pub fn set_overrides( self: Handle<Self>, app: &mut App, overrides: Rc<dyn RendererBindingOverrides>, )
Registers the binding layered above this one, as Flutter’s WidgetsBinding does by
overriding drawFrame.
Sourcepub fn draw_frame(self: Handle<Self>, app: &mut App, views: &[ViewId])
pub fn draw_frame(self: Handle<Self>, app: &mut App, views: &[ViewId])
Pump the rendering pipeline to generate a frame of views.
This method is called by handle_draw_frame, which itself is called automatically by
the host when it is time to lay out and paint a frame.
Each frame consists of the following phases: layout and compositing bits for every
render tree, then paint and compositing for the RenderView of each of views. A view
paints its own render tree alone, not the views anchored in it, which paint at frames of
their own; it is composited only when it needs it,
and otherwise keeps showing its last frame.
Sourcepub fn init_render_view(
self: Handle<Self>,
app: &mut App,
view: ViewRef,
) -> RenderHandle<RenderView>
pub fn init_render_view( self: Handle<Self>, app: &mut App, view: ViewRef, ) -> RenderHandle<RenderView>
Flutter’s TestRenderingFlutterBinding.initRenderView: makes a RenderView for view
the root of root_pipeline_owner, registers it, and
prepares its first frame. Idempotent, as _ReusableRenderView is: a later call answers
the first call’s render view.
Trait Implementations§
Source§impl Default for RendererBinding
impl Default for RendererBinding
Source§impl GestureBindingOverridesObject for RendererBinding
Flutter’s RendererBinding.hitTestInView override: the render view for view_id hit-tests
first; GestureBinding then adds itself.
Flutter’s RendererBinding overrides of GestureBinding: hitTestInView walks the render
trees, dispatchEvent updates the mouse tracker before routing.
impl GestureBindingOverridesObject for RendererBinding
Flutter’s RendererBinding.hitTestInView override: the render view for view_id hit-tests
first; GestureBinding then adds itself.
Flutter’s RendererBinding overrides of GestureBinding: hitTestInView walks the render
trees, dispatchEvent updates the mouse tracker before routing.