Skip to main content

ServerRedirectVisual

Struct ServerRedirectVisual 

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

Server-side counterpart of a RedirectVisual: draws the subtree of its source in its own coordinates, under its children.

The source is rendered through the hidden visual surface of the visual (ServerCompositionVisualSurface::render_source_subtree), which keeps the guard against a redirect visual inside the subtree of its own source and follows the changes of the source (the visual observes the surface). The bounds of the visual are its own rectangle and the bounds of the content and children of the source, taken when the update pass of the target reaches the visual; inside the subtree of its own source they are its own rectangle only, so it draws nothing of the source there.

Deviation (winui-composition.md): when the source comes after the redirect visual in the tree, a change of the extent of the source reaches the bounds of the redirect visual one frame later.

Implementations§

Source§

impl ServerRedirectVisual

Source

pub fn new() -> Self

Source

pub fn props(&self) -> &ServerRedirectVisualProps

The properties of the visual.

Source

pub fn source(&self) -> Option<Rc<ServerCompositionVisual>>

The visual whose subtree is shown.

Source

pub fn source_surface(&self) -> Option<Rc<ServerCompositionVisualSurface>>

The hidden surface that renders the source.

Trait Implementations§

Source§

impl Default for ServerRedirectVisual

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl IServerVisualContent for ServerRedirectVisual

Source§

fn compute_own_content_bounds( &self, visual: &ServerCompositionVisual, ) -> Option<LtrbRect>

The rectangle of the visual and the extent of the source subtree (not when the visual is inside that subtree: it is not drawn inside itself).

Source§

fn dependency_queued_invalidate(&self, visual: &ServerCompositionVisual)

The source subtree changed (the surface was invalidated).

Source§

fn deserialize_changes_core( &self, visual: &ServerCompositionVisual, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )

DeserializeChangesCore of the class; the default is the one of the container visual.
Source§

fn has_update_pass_content_bounds(&self) -> bool

Whether the bounds of the own content depend on other visuals and are computed again when the update pass of the target reaches the visual (not from upstream; a redirect visual covers the bounds of its source as that pass leaves them).
Source§

fn size_changed(&self, visual: &ServerCompositionVisual)

Source§

fn render_core( &self, _visual: &ServerCompositionVisual, context: &mut ServerVisualRenderContext<'_>, current_transformed_clip: LtrbRect, )

Source§

fn dispose(&self, visual: &ServerCompositionVisual)

The visual has been disposed on the UI thread.
Source§

fn find_props(&self, type_id: TypeId) -> Option<&dyn Any>

The generated property block of the given type, if the class has one of its own.
Source§

fn get_composition_property( &self, name: &str, ) -> Option<&'static CompositionProperty>

Source§

fn as_any(&self) -> &dyn Any

Source§

fn on_attached_to_root( &self, _visual: &ServerCompositionVisual, _target: &Rc<ServerCompositionTarget>, )

Source§

fn on_detached_from_root( &self, _visual: &ServerCompositionVisual, _target: &Rc<ServerCompositionTarget>, )

Source§

fn push_clip_to_bounds( &self, visual: &ServerCompositionVisual, canvas: &mut dyn IDrawingContextImpl, )

Source§

fn has_effect(&self, visual: &ServerCompositionVisual) -> bool

Source§

fn render_after_children( &self, _visual: &ServerCompositionVisual, _context: &mut ServerVisualRenderContext<'_>, )

Called by the render walk after the children of the visual were rendered, before the opacity mask, effect, clips and transform of the visual are popped: what render_core pushed for the children is popped here (not from upstream; the layer of a layer visual).
Source§

fn sub_tree_bounds_padding( &self, _visual: &ServerCompositionVisual, ) -> Option<Thickness>

What the content adds around the bounds of the subtree, like the output padding of an effect (not from upstream; the shadow of a layer visual). None for nothing.

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