Skip to main content

RenderView

Struct RenderView 

Source
pub struct RenderView {
    pub automatic_system_ui_adjustment: bool,
    /* private fields */
}
Expand description

The root of the render tree.

The view represents the total output surface of the render tree and handles bootstrapping the rendering pipeline. The view has a unique child crate::RenderBox, which is required to fill the entire output surface.

Not a box: its constraints come from its configuration, and its child is the one slot Flutter’s RenderObjectWithChildMixin gives it.

Fields§

§automatic_system_ui_adjustment: bool

Whether the system overlays are styled from the layer tree at every frame.

An application that would rather drive them itself, through SystemChrome::set_system_ui_overlay_style, turns this off so its own style is not overwritten by whatever happens to be annotated under the bars.

Implementations§

Source§

impl RenderView

Source

pub fn new( app: &mut App, child: Option<AnyRenderBox>, configuration: Option<ViewConfiguration>, view: ViewRef, ) -> RenderHandle<RenderView>

Creates the root of the render tree.

Typically created by the binding (e.g., RendererBinding).

Providing a configuration is optional, but a configuration must be set before calling prepare_initial_frame.

Source

pub fn as_object(self: RenderHandle<Self>) -> AnyRenderObject

The type-erased RenderObject handle.

Source

pub fn child(self: RenderHandle<Self>, app: &App) -> Option<AnyRenderBox>

The render object’s unique child. Flutter’s RenderObjectWithChildMixin.child.

Source

pub fn set_child( self: RenderHandle<Self>, app: &mut App, value: Option<AnyRenderBox>, )

Sets the unique child, adopting or dropping as Flutter’s setter does.

Source

pub fn size(self: RenderHandle<Self>, app: &App) -> Size

The current layout size of the view.

Source

pub fn configuration(self: RenderHandle<Self>, app: &App) -> ViewConfiguration

The constraints used for the root layout.

Typically, this configuration is set by the RendererBinding, when the RenderView is registered with it. It will also update the configuration if necessary. Therefore, if used in conjunction with the RendererBinding this property must not be set manually as the RendererBinding will just override it.

§Panics

If no configuration has been set.

Source

pub fn set_configuration( self: RenderHandle<Self>, app: &mut App, value: ViewConfiguration, )

Source

pub fn has_configuration(self: RenderHandle<Self>, app: &App) -> bool

Whether a configuration has been set.

Source

pub fn constraints(self: RenderHandle<Self>, app: &App) -> BoxConstraints

The constraints most recently supplied for layout: the configuration’s logical constraints.

§Panics

If no configuration has been set.

Source

pub fn flutter_view(self: RenderHandle<Self>, app: &App) -> ViewRef

The host view into which this render tree is rendered.

Source

pub fn prepare_initial_frame(self: RenderHandle<Self>, app: &mut App)

Bootstrap the rendering pipeline by preparing the first frame.

This should only be called once, and must be called before changing configuration. It is typically called immediately after calling the constructor.

This does not actually schedule the first frame. Call SchedulerBinding::ensure_visual_update for that.

Source

pub fn needs_composite_frame(self: RenderHandle<Self>, app: &App) -> bool

Whether this view must be composited on the next frame.

This flag is cleared once the view gets successfully composited.

Source

pub fn mark_needs_composite_frame(self: RenderHandle<Self>, app: &mut App)

Marks this view required to be composited on the next frame.

This happens by the PipelineOwner during flush_paint if there are any render objects that need to be painted. It is also set for a new view, for the warm-up frame, and when the app is resumed from the background.

Source

pub fn hit_test( self: RenderHandle<Self>, app: &mut App, result: &mut HitTestResult, position: Offset, ) -> bool

Determines the set of render objects located at the given position.

Returns true if the given point is contained in this render object or one of its descendants. Adds any render objects that contain the point to the given hit test result.

The position argument is in the coordinate system of the render view, which is to say, in logical pixels. This is not necessarily the same coordinate system as that expected by the root layer (which is in physical pixels).

Source

pub fn composite_frame(self: RenderHandle<Self>, app: &mut App)

Uploads the composited layer tree to the host.

Actually causes the output of the rendering pipeline to appear on screen.

Source

pub fn paint_bounds(self: RenderHandle<Self>, app: &App) -> Rect

An estimate of the bounds within which this render object will paint, in physical pixels.

Trait Implementations§

Source§

impl RenderObject for RenderView

Source§

fn render_object_data(self: RenderHandle<Self>, app: &App) -> &RenderObjectData

Mixin field access.
Source§

fn render_object_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderObjectData

Source§

fn perform_resize(self: RenderHandle<Self>, _app: &mut App)

Updates the render object’s size using only the constraints. Read more
Source§

fn perform_layout(self: RenderHandle<Self>, app: &mut App)

Do the work of computing the layout for this render object. Read more
Source§

fn visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), )

Calls visitor for each immediate child.
Source§

fn apply_paint_transform( self: RenderHandle<Self>, app: &App, child: AnyRenderObject, transform: &mut Matrix4, )

Applies the transform that would be applied when painting the given child to the given matrix. Read more
Source§

fn is_repaint_boundary(self: RenderHandle<Self>, _app: &App) -> bool

Whether this render object repaints separately from its parent. Read more
Source§

fn paint( self: RenderHandle<Self>, app: &mut App, context: &mut PaintingContext, offset: Offset, )

Paint this render object into the given context at the given offset. Read more
Source§

fn as_render_object(self: RenderHandle<Self>, app: &App) -> AnyRenderObject

Dart’s implicit upcast of a concrete render object to RenderObject: this object’s type-erased handle, through the vtable the protocol recorded when it created it.
Source§

fn setup_parent_data( self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject, )

Sets up parent data for child if it has none. Read more
Source§

fn did_attach( self: RenderHandle<Self>, app: &mut App, owner: Handle<PipelineOwner>, )

The body of Flutter’s attach override after super.attach(owner); the base body has already run. The default attaches the children reported by visit_children.
Source§

fn did_detach(self: RenderHandle<Self>, app: &mut App)

The body of Flutter’s detach override after super.detach(). The default detaches the children reported by visit_children.
Source§

fn redepth_children(self: RenderHandle<Self>, app: &mut App)

Adjusts the depth of each child reported by visit_children.
Source§

fn sized_by_parent(self: RenderHandle<Self>, _app: &App) -> bool

Whether the constraints are the only input to the sizing algorithm.
Source§

fn always_needs_compositing(self: RenderHandle<Self>, _app: &App) -> bool

Whether this render object always needs compositing. Read more
Source§

fn mouse_tracker_annotation( self: RenderHandle<Self>, _app: &App, ) -> Option<MouseTrackerAnnotation>

Dart’s this is MouseTrackerAnnotation: the annotation this render object implements, read live each time the mouse tracker consults it. None for a render object that is not an annotation, which is the default.
Source§

fn update_composited_layer( self: RenderHandle<Self>, app: &mut App, old_layer: Option<AnyOffsetLayer>, ) -> AnyOffsetLayer

Update the composited layer owned by this render object. Read more
Source§

fn show_on_screen( self: RenderHandle<Self>, app: &mut App, descendant: Option<AnyRenderObject>, rect: Option<Rect>, duration: Duration, curve: Rc<dyn Curve>, )

Attempt to make (a portion of) this or a descendant RenderObject visible on screen. Read more
Source§

fn interface(self: RenderHandle<Self>, id: TypeId) -> Option<Box<dyn Any>>

Dart’s object is RenderAbstractViewport for any interface: the erased handle of the interface id names, if this type implements it. Read more
Source§

fn dispose(self: RenderHandle<Self>, app: &mut App)

Release any resources held by this render object. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RenderObjectBase for T
where T: RenderObject,

Source§

fn dispose(self: RenderHandle<Self>, app: &mut App)

Flutter’s RenderObject.dispose body: releases the layer handle. An override calls it last, where Dart writes super.dispose().
Source§

fn mark_needs_layout(self: RenderHandle<Self>, app: &mut App)

Flutter’s RenderObject.markNeedsLayout body; an override calls it where Dart writes super.markNeedsLayout().
Source§

fn show_on_screen( self: RenderHandle<Self>, app: &mut App, descendant: Option<AnyRenderObject>, rect: Option<Rect>, duration: Duration, curve: Rc<dyn Curve>, )

Flutter’s RenderObject.showOnScreen.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>