pub struct ServerLayerVisual { /* private fields */ }Expand description
Server-side counterpart of a
LayerVisual: its children
are composed into an offscreen layer (push_layer over the bounds of the
subtree), which the opacity of the visual applies to as a whole.
With a shadow, the children are composed through a drop shadow effect
when the drawing context has effects, so the shadow follows the alpha of
the composed content; otherwise the box shadow of the rectangle of the
visual is drawn under the layer. A shadow with a Mask (and the
Default source policy) is the shadow of the alpha of the mask over the
rectangle of the visual, drawn under the layer
(ServerDropShadow::render_under_rect).
With an effect (an effect brush), the composed children are the first source parameter of its graph: what the graph draws under the layer and what wraps it are drawn and pushed before the children, inside the layer (or the shadow), and popped and drawn after them.
Deviation (winui-composition.md): without effect support in the drawing context the shadow is the box shadow of the rectangle of the visual, as for a sprite visual.
Implementations§
Source§impl ServerLayerVisual
impl ServerLayerVisual
pub fn new() -> Self
Sourcepub fn props(&self) -> &ServerLayerVisualProps
pub fn props(&self) -> &ServerLayerVisualProps
The properties of the visual.
Sourcepub fn shadow(&self) -> Option<Rc<ServerDropShadow>>
pub fn shadow(&self) -> Option<Rc<ServerDropShadow>>
The shadow.
Sourcepub fn effect_brush(&self) -> Option<Rc<ServerCompositionEffectBrush>>
pub fn effect_brush(&self) -> Option<Rc<ServerCompositionEffectBrush>>
The effect brush applied to the composed children (the WinUI
Effect).
Trait Implementations§
Source§impl Default for ServerLayerVisual
impl Default for ServerLayerVisual
Source§impl IServerVisualContent for ServerLayerVisual
impl IServerVisualContent for ServerLayerVisual
Source§fn compute_own_content_bounds(
&self,
visual: &ServerCompositionVisual,
) -> Option<LtrbRect>
fn compute_own_content_bounds( &self, visual: &ServerCompositionVisual, ) -> Option<LtrbRect>
The area of the box shadow of the rectangle, when there is a shadow (what the fallback draws); a layer visual has no content of its own.
Source§fn sub_tree_bounds_padding(
&self,
visual: &ServerCompositionVisual,
) -> Option<Thickness>
fn sub_tree_bounds_padding( &self, visual: &ServerCompositionVisual, ) -> Option<Thickness>
The shadow of the composed children extends the subtree as the drop shadow effect does, and the blurs of the effect around the layer as the blur effect does.
Source§fn has_effect(&self, visual: &ServerCompositionVisual) -> bool
fn has_effect(&self, visual: &ServerCompositionVisual) -> bool
A shadow or an effect depends on every change of the subtree, as an effect does.
Source§fn dependency_queued_invalidate(&self, visual: &ServerCompositionVisual)
fn dependency_queued_invalidate(&self, visual: &ServerCompositionVisual)
The shadow or the effect changed.
Source§fn deserialize_changes_core(
&self,
visual: &ServerCompositionVisual,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
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.fn size_changed(&self, visual: &ServerCompositionVisual)
fn render_core( &self, visual: &ServerCompositionVisual, context: &mut ServerVisualRenderContext<'_>, _current_transformed_clip: LtrbRect, )
Source§fn render_after_children(
&self,
visual: &ServerCompositionVisual,
context: &mut ServerVisualRenderContext<'_>,
)
fn render_after_children( &self, visual: &ServerCompositionVisual, context: &mut ServerVisualRenderContext<'_>, )
render_core pushed for the children is
popped here (not from upstream; the layer of a layer visual).Source§fn dispose(&self, visual: &ServerCompositionVisual)
fn dispose(&self, visual: &ServerCompositionVisual)
Source§fn find_props(&self, type_id: TypeId) -> Option<&dyn Any>
fn find_props(&self, type_id: TypeId) -> Option<&dyn Any>
fn get_composition_property( &self, name: &str, ) -> Option<&'static CompositionProperty>
fn as_any(&self) -> &dyn Any
fn on_attached_to_root( &self, _visual: &ServerCompositionVisual, _target: &Rc<ServerCompositionTarget>, )
fn on_detached_from_root( &self, _visual: &ServerCompositionVisual, _target: &Rc<ServerCompositionTarget>, )
fn push_clip_to_bounds( &self, visual: &ServerCompositionVisual, canvas: &mut dyn IDrawingContextImpl, )
Source§fn has_update_pass_content_bounds(&self) -> bool
fn has_update_pass_content_bounds(&self) -> bool
Auto Trait Implementations§
impl !Freeze for ServerLayerVisual
impl !RefUnwindSafe for ServerLayerVisual
impl !Send for ServerLayerVisual
impl !Sync for ServerLayerVisual
impl !UnwindSafe for ServerLayerVisual
impl Unpin for ServerLayerVisual
impl UnsafeUnpin for ServerLayerVisual
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more