Skip to main content

TopLevelFramebufferSurface

Struct TopLevelFramebufferSurface 

Source
pub struct TopLevelFramebufferSurface { /* private fields */ }
Expand description

The software (framebuffer) render surface of a top-level.

The surface is shared with the thread that renders. The rule of the reference is kept: the render target is created on the UI thread only (the first show and every resize are rendered by the UI thread), and the frames of the render thread reuse it.

Trait Implementations§

Source§

impl IFramebufferPlatformSurface for TopLevelFramebufferSurface

Source§

fn create_framebuffer_render_target(&self) -> Rc<dyn IFramebufferRenderTarget>

§Panics

Panics when called off the UI thread or when the top-level has no native render target (it is closed): the render target is not ready.

Source§

impl IPlatformRenderSurface for TopLevelFramebufferSurface

Source§

fn is_ready(&self) -> bool

Deviation (DEVIATIONS.md, Native backend): the reference throws RenderTargetNotReadyException from CreateFramebufferRenderTarget off the UI thread and the composition target catches it; here the surface answers that it is not ready (off the UI thread, and once the top-level is disposed), which the composition target treats the same way, without a panic to catch.

Source§

fn as_framebuffer_surface(&self) -> Option<&dyn IFramebufferPlatformSurface>

The surface as a framebuffer surface, if it is one.
Source§

fn as_any(&self) -> &dyn Any

Lets the backend recover the concrete surface type.
Source§

fn try_get_surface_kind(&self, _kind: TypeId) -> Option<Rc<dyn Any>>

The surface viewed as a surface kind defined outside this crate: for TypeId::of::<dyn IFoo>() the result holds an Rc<dyn IFoo>.
Source§

fn text_rendering_parameters(&self) -> Option<PlatformTextRenderingParameters>

The text rendering settings of the platform for this surface, when the platform knows them: the render backend asks for them every frame (they follow the settings of the system and the display the surface is on). A backend asks every surface of a top-level and takes the first answer; None from all of them gives the defaults of the backend (docs/porting/text-rendering.md).

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<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, 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.