pub struct ServerCompositionVisual { /* private fields */ }Expand description
Server-side CompositionVisual counterpart. Is responsible for
computing the transformation matrix, for applying various visual
properties before calling visual-specific drawing code and for notifying
the ServerCompositionTarget for new dirty rects.
Implementations§
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
Sourcepub fn ancestor_transform_subscriber_count(&self) -> usize
pub fn ancestor_transform_subscriber_count(&self) -> usize
The number of subscribers to the transforms of the ancestor chain of the visual: the adorners of the visual, and its children that have subscribers of their own (a diagnostics member, used by tests to verify that subscriptions are released).
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
pub fn adorner_helper_enqueue_for_adorner_update(&self)
pub fn update_adorner(&self)
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
Sourcepub fn composition_clip(&self) -> Option<Rc<dyn IServerObject>>
pub fn composition_clip(&self) -> Option<Rc<dyn IServerObject>>
The WinUI clip object of the visual (a server-side InsetClip or
RectangleClip).
Sourcepub fn composition_clip_shape(&self) -> Option<CompositionClipShape>
pub fn composition_clip_shape(&self) -> Option<CompositionClipShape>
The area the WinUI clip of the visual leaves visible, in the coordinates of the visual.
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
pub fn own_transform(&self) -> Option<Matrix>
pub fn sub_tree_bounds(&self) -> Option<LtrbRect>
pub fn transformed_sub_tree_bounds(&self) -> Option<LtrbRect>
pub fn compute_own_content_bounds(&self) -> Option<LtrbRect>
pub fn combined_transform_matrix(&self) -> Matrix
Sourcepub fn has_pending_render_changes(&self) -> bool
pub fn has_pending_render_changes(&self) -> bool
Whether the visual or a visual of its subtree changed since the last update pass of its target: what a visual surface showing the subtree follows (not from upstream).
pub fn recompute_own_properties(&self)
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
pub fn get_readback(&self, reader_revision: u64) -> Option<ReadbackData>
pub fn update_readback(&self, writer_revision: u64, reader_revision: u64)
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
Sourcepub fn render(
self: &Rc<Self>,
canvas: &mut dyn IDrawingContextImpl,
clip: LtrbRect,
dirty_rects: Option<Rc<dyn IDirtyRectTracker>>,
render_children: bool,
skip_root_visual_transform: bool,
rendering_to_bitmap_cache: bool,
) -> (i32, i32)
pub fn render( self: &Rc<Self>, canvas: &mut dyn IDrawingContextImpl, clip: LtrbRect, dirty_rects: Option<Rc<dyn IDirtyRectTracker>>, render_children: bool, skip_root_visual_transform: bool, rendering_to_bitmap_cache: bool, ) -> (i32, i32)
Renders the visual and, with render_children, its subtree onto
canvas. Returns the numbers of visited and rendered visuals.
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
pub fn update_root( self: &Rc<Self>, tracker: Rc<dyn IDirtyRectCollector>, transform: Matrix, clip: LtrbRect, )
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
Sourcepub fn rotation_axis(&self) -> Vector3D
pub fn rotation_axis(&self) -> Vector3D
The axis RotationAngle rotates about.
Sourcepub fn relative_offset_adjustment(&self) -> Vector3D
pub fn relative_offset_adjustment(&self) -> Vector3D
The part of the size of the parent added to the offset.
Sourcepub fn relative_size_adjustment(&self) -> Vector
pub fn relative_size_adjustment(&self) -> Vector
The part of the size of the parent added to the size.
pub fn is_hit_test_visible(&self) -> bool
pub fn is_pixel_snapping_enabled(&self) -> bool
pub fn border_mode(&self) -> CompositionBorderMode
pub fn backface_visibility(&self) -> CompositionBackfaceVisibility
pub fn composite_mode(&self) -> CompositionCompositeMode
Sourcepub fn parent_for_transform(&self) -> Option<Rc<ServerCompositionVisual>>
pub fn parent_for_transform(&self) -> Option<Rc<ServerCompositionVisual>>
The visual whose coordinate space the transform of this visual is relative to.
Sourcepub fn depth_offset(&self, z: f32) -> Vector
pub fn depth_offset(&self, z: f32) -> Vector
Where something at the depth z of the space of the visual is drawn,
relative to the same thing at the depth 0, in that space (phase 7, not
from upstream: the Z of the offset of a drop shadow).
The renderers project the 3D part of the transform of a visual (its
Orientation, a RotationAxis out of the plane, the Z of its
Scale) orthographically onto the plane of the parent. A point at the
depth z is moved by that projection of (0, 0, z): nothing for a
visual in its plane, along the tilt for a visual turned out of it.
The result is that move brought back into the space of the visual.
Deviation (winui-composition.md): only the 3D part of the visual’s own transform is taken; the 3D transforms of its ancestors are already flattened, and there is no perspective.
Sourcepub fn unclipped_sub_tree_bounds(&self) -> Option<LtrbRect>
pub fn unclipped_sub_tree_bounds(&self) -> Option<LtrbRect>
The bounds of the content and the children of the visual in its own coordinates, with the padding of its effect, ignoring its own clip and visibility: what a visual surface or a redirect visual that shows the visual covers (not from upstream). As of the last update of the target of the visual.
Sourcepub fn is_self_or_descendant_of(
&self,
ancestor: &ServerCompositionVisual,
) -> bool
pub fn is_self_or_descendant_of( &self, ancestor: &ServerCompositionVisual, ) -> bool
Whether ancestor is this visual or one of its ancestors.
Source§impl ServerCompositionVisual
impl ServerCompositionVisual
Sourcepub fn new(
compositor: &Rc<ServerCompositor>,
children: Option<Rc<ServerCompositionVisualCollection>>,
readback: Arc<VisualReadback>,
content: Box<dyn IServerVisualContent>,
) -> Rc<ServerCompositionVisual>
pub fn new( compositor: &Rc<ServerCompositor>, children: Option<Rc<ServerCompositionVisualCollection>>, readback: Arc<VisualReadback>, content: Box<dyn IServerVisualContent>, ) -> Rc<ServerCompositionVisual>
Creates a server visual. children is the server side of the
children collection (created before the visual by the UI thread),
readback the readback slots shared with the UI-thread visual, and
content the concrete class.
Sourcepub fn weak(&self) -> Weak<ServerCompositionVisual>
pub fn weak(&self) -> Weak<ServerCompositionVisual>
A weak handle of the visual.
Sourcepub fn compositor(&self) -> Option<Rc<ServerCompositor>>
pub fn compositor(&self) -> Option<Rc<ServerCompositor>>
The compositor of the visual, while it is alive.
Sourcepub fn object(&self) -> &ServerObject
pub fn object(&self) -> &ServerObject
The ServerObject part: activation and animations.
pub fn activate(&self)
pub fn deactivate(&self)
Sourcepub fn content(&self) -> &dyn IServerVisualContent
pub fn content(&self) -> &dyn IServerVisualContent
The concrete class of the visual.
Sourcepub fn content_as<T: IServerVisualContent>(&self) -> Option<&T>
pub fn content_as<T: IServerVisualContent>(&self) -> Option<&T>
The concrete class of the visual as T.
pub fn children(&self) -> Option<&Rc<ServerCompositionVisualCollection>>
pub fn cache(&self) -> Option<Rc<ServerCompositionVisualCache>>
Sourcepub fn visual_props(&self) -> &ServerCompositionVisualProps
pub fn visual_props(&self) -> &ServerCompositionVisualProps
The generated properties of the visual class.
pub fn root(&self) -> Option<Rc<ServerCompositionTarget>>
pub fn parent(&self) -> Option<Rc<ServerCompositionVisual>>
pub fn adorned_visual(&self) -> Option<Rc<ServerCompositionVisual>>
pub fn cache_mode(&self) -> Option<Rc<ServerCompositionBitmapCache>>
pub fn visible(&self) -> bool
pub fn opacity(&self) -> f32
pub fn clip(&self) -> Option<Arc<dyn IGeometryImpl>>
pub fn clip_to_bounds(&self) -> bool
Sourcepub fn offset(&self) -> Vector3D
pub fn offset(&self) -> Vector3D
The offset of the visual, with its WinUI RelativeOffsetAdjustment
applied (the part of the size of the parent it adds).
pub fn translation(&self) -> Vector3D
Sourcepub fn size(&self) -> Vector
pub fn size(&self) -> Vector
The size of the visual, with its WinUI RelativeSizeAdjustment
applied (the part of the size of the parent it adds): what is
rendered and clipped.
pub fn anchor_point(&self) -> Vector
pub fn center_point(&self) -> Vector3D
pub fn rotation_angle(&self) -> f32
pub fn orientation(&self) -> Quaternion
pub fn scale(&self) -> Vector3D
pub fn transform_matrix(&self) -> Matrix
pub fn adorner_is_clipped(&self) -> bool
pub fn opacity_mask_brush(&self) -> Option<Rc<dyn IBrush>>
pub fn effect(&self) -> Option<Arc<dyn IImmutableEffect>>
pub fn render_options(&self) -> RenderOptions
pub fn text_options(&self) -> TextOptions
pub fn on_cache_mode_state_changed(&self)
Sourcepub fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
pub fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
DeserializeChangesCore of the container visual class: what the
concrete classes call as their base.
Trait Implementations§
Source§impl IAnimatedServerObject for ServerCompositionVisual
impl IAnimatedServerObject for ServerCompositionVisual
Source§fn server_object(&self) -> &ServerObject
fn server_object(&self) -> &ServerObject
ServerObject part.Source§fn get_composition_property(
&self,
field_name: &str,
) -> Option<&'static CompositionProperty>
fn get_composition_property( &self, field_name: &str, ) -> Option<&'static CompositionProperty>
Source§fn as_server_object_dyn(&self) -> &dyn IServerObject
fn as_server_object_dyn(&self) -> &dyn IServerObject
Source§fn read_property_variant(
&self,
property: &'static CompositionProperty,
) -> ExpressionVariant
fn read_property_variant( &self, property: &'static CompositionProperty, ) -> ExpressionVariant
CompositionProperty::get_variant; an object with dynamic properties (a property set)
reads its own storage.Source§fn write_property_variant(
&self,
property: &'static CompositionProperty,
value: ExpressionVariant,
)
fn write_property_variant( &self, property: &'static CompositionProperty, value: ExpressionVariant, )
CompositionProperty::set_variant; an object with dynamic properties writes its own
storage.Source§impl IExpressionObject for ServerCompositionVisual
impl IExpressionObject for ServerCompositionVisual
Source§fn get_property(&self, name: &str) -> ExpressionVariant
fn get_property(&self, name: &str) -> ExpressionVariant
Invalid when
there is no such property.Source§fn key(&self) -> ExpressionObjectKey
fn key(&self) -> ExpressionObjectKey
ExpressionTrackedObjects). The default is the
address of the object, which is its reference identity for as long as
the object is alive and not moved; an implementation that has a stable
identifier should return that instead.Source§impl IServerAnimatedPropertyHost for ServerCompositionVisual
impl IServerAnimatedPropertyHost for ServerCompositionVisual
Source§fn set_animated_value(
&self,
property: &'static CompositionProperty,
current_value: ExpressionVariant,
committed_at: Duration,
animation: Rc<dyn IAnimationInstance>,
)
fn set_animated_value( &self, property: &'static CompositionProperty, current_value: ExpressionVariant, committed_at: Duration, animation: Rc<dyn IAnimationInstance>, )
SetAnimatedValue(prop, ref field, committedAt, animation): starts
animation on the property. current_value is the value of the
field as a variant; the animation writes the field through
CompositionProperty::set_variant.Source§fn remove_animation_for_property(&self, property: &'static CompositionProperty)
fn remove_animation_for_property(&self, property: &'static CompositionProperty)
SetAnimatedValue(prop, out field, value): the field
has been assigned directly, so the animation of the property, if
any, is removed.Source§fn notify_animated_value_changed(&self, property: &'static CompositionProperty)
fn notify_animated_value_changed(&self, property: &'static CompositionProperty)
property.Source§impl IServerObject for ServerCompositionVisual
impl IServerObject for ServerCompositionVisual
Source§fn dispose(&self)
fn dispose(&self)
Releases what the visual holds. Upstream the garbage collector reclaims a server visual once nothing refers to it; here the UI thread disposes it by id, and the references that would keep a cycle alive are dropped without notifications.
Source§fn deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
Source§fn get_props(&self, type_id: TypeId) -> Option<&dyn Any>
fn get_props(&self, type_id: TypeId) -> Option<&dyn Any>
find_props; composition properties locate their
fields through it.Source§fn as_animated(self: Rc<Self>) -> Option<Rc<dyn IAnimatedServerObject>>
fn as_animated(self: Rc<Self>) -> Option<Rc<dyn IAnimatedServerObject>>
fn as_any(&self) -> &dyn Any
fn into_any_rc(self: Rc<Self>) -> Rc<dyn Any>
Source§fn values_invalidated(&self)
fn values_invalidated(&self)
Source§fn deserialize_changes(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn deserialize_changes( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
Source§fn as_render_resource(self: Rc<Self>) -> Option<Rc<dyn IServerRenderResource>>
fn as_render_resource(self: Rc<Self>) -> Option<Rc<dyn IServerRenderResource>>
Source§fn as_brush(self: Rc<Self>) -> Option<Rc<dyn IBrush>>
fn as_brush(self: Rc<Self>) -> Option<Rc<dyn IBrush>>
Source§fn as_pen(self: Rc<Self>) -> Option<Rc<dyn IPen>>
fn as_pen(self: Rc<Self>) -> Option<Rc<dyn IPen>>
Source§fn as_render_data_geometry(
self: Rc<Self>,
) -> Option<Rc<dyn IRenderDataGeometry>>
fn as_render_data_geometry( self: Rc<Self>, ) -> Option<Rc<dyn IRenderDataGeometry>>
Source§fn as_transform(self: Rc<Self>) -> Option<Rc<dyn ITransform>>
fn as_transform(self: Rc<Self>) -> Option<Rc<dyn ITransform>>
Source§fn as_gradient_stop(self: Rc<Self>) -> Option<Rc<dyn IGradientStop>>
fn as_gradient_stop(self: Rc<Self>) -> Option<Rc<dyn IGradientStop>>
Source§fn as_surface(self: Rc<Self>) -> Option<Rc<dyn IServerCompositionSurface>>
fn as_surface(self: Rc<Self>) -> Option<Rc<dyn IServerCompositionSurface>>
Source§impl IServerPropertyHost for ServerCompositionVisual
impl IServerPropertyHost for ServerCompositionVisual
Source§fn server_compositor(&self) -> Option<Rc<ServerCompositor>>
fn server_compositor(&self) -> Option<Rc<ServerCompositor>>
Source§fn set_value(
&self,
property: &'static CompositionProperty,
change: ServerValueChange<'_>,
)
fn set_value( &self, property: &'static CompositionProperty, change: ServerValueChange<'_>, )
SetValue(prop, ref field, value) as the class of the object
defines it. A plain server object assigns; an animated object also
invalidates the subscriptions of the property; a render resource
goes through super::ServerRenderResourceCore::set_value.Source§impl IServerRenderResourceObserver for ServerCompositionVisual
impl IServerRenderResourceObserver for ServerCompositionVisual
fn dependency_queued_invalidate(&self, sender: &dyn IServerRenderResource)
impl ServerCompositionContainerVisualHooks for ServerCompositionVisual
Source§impl ServerCompositionExperimentalAcrylicVisualHooks for ServerCompositionVisual
impl ServerCompositionExperimentalAcrylicVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerCompositionDrawListVisual.fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized( &self, _changed: CompositionExperimentalAcrylicVisualChangedFields, )
fn on_material_changed(&self)
fn on_material_changing(&self)
fn on_corner_radius_changed(&self)
fn on_corner_radius_changing(&self)
Source§impl ServerCompositionSolidColorVisualHooks for ServerCompositionVisual
impl ServerCompositionSolidColorVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerSizeDependantVisual.fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized( &self, _changed: CompositionSolidColorVisualChangedFields, )
Source§impl ServerCompositionSurfaceVisualHooks for ServerCompositionVisual
impl ServerCompositionSurfaceVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerSizeDependantVisual.fn on_surface_changed(&self)
fn on_surface_changing(&self)
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized( &self, _changed: CompositionSurfaceVisualChangedFields, )
Source§impl ServerCompositionVisualHooks for ServerCompositionVisual
impl ServerCompositionVisualHooks for ServerCompositionVisual
fn on_fields_deserialized(&self, changed: CompositionVisualChangedFields)
fn on_root_changing(&self)
fn on_root_changed(&self)
fn on_parent_changing(&self)
fn on_parent_changed(&self)
fn on_adorned_visual_changing(&self)
fn on_adorned_visual_changed(&self)
fn on_cache_mode_changing(&self)
fn on_composition_clip_changing(&self)
fn on_composition_clip_changed(&self)
fn on_parent_for_transform_changing(&self)
fn on_parent_for_transform_changed(&self)
fn on_cache_mode_changed(&self)
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_clip_changed(&self)
fn on_clip_changing(&self)
fn on_adorner_is_clipped_changed(&self)
fn on_adorner_is_clipped_changing(&self)
fn on_opacity_mask_brush_changed(&self)
fn on_opacity_mask_brush_changing(&self)
fn on_effect_changed(&self)
fn on_effect_changing(&self)
fn on_render_options_changed(&self)
fn on_render_options_changing(&self)
fn on_text_options_changed(&self)
fn on_text_options_changing(&self)
fn on_is_hit_test_visible_changed(&self)
fn on_is_hit_test_visible_changing(&self)
fn on_is_pixel_snapping_enabled_changed(&self)
fn on_is_pixel_snapping_enabled_changing(&self)
fn on_border_mode_changed(&self)
fn on_border_mode_changing(&self)
fn on_backface_visibility_changed(&self)
fn on_backface_visibility_changing(&self)
fn on_composite_mode_changed(&self)
fn on_composite_mode_changing(&self)
Source§impl ServerLayerVisualHooks for ServerCompositionVisual
impl ServerLayerVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerSizeDependantVisual.fn on_shadow_changing(&self)
fn on_shadow_changed(&self)
fn on_effect_brush_changing(&self)
fn on_effect_brush_changed(&self)
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized(&self, _changed: LayerVisualChangedFields)
Source§impl ServerRedirectVisualHooks for ServerCompositionVisual
impl ServerRedirectVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerSizeDependantVisual.fn on_source_changed(&self)
fn on_source_surface_changing(&self)
fn on_source_surface_changed(&self)
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized(&self, _changed: RedirectVisualChangedFields)
fn on_source_changing(&self)
Source§impl ServerShapeVisualHooks for ServerCompositionVisual
impl ServerShapeVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerSizeDependantVisual.fn on_shapes_changing(&self)
fn on_shapes_changed(&self)
fn on_view_box_changing(&self)
fn on_view_box_changed(&self)
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized(&self, _changed: ShapeVisualChangedFields)
Source§impl ServerSpriteVisualHooks for ServerCompositionVisual
impl ServerSpriteVisualHooks for ServerCompositionVisual
Source§fn base_deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
fn base_deserialize_changes_core( &self, reader: &mut BatchStreamReader<'_>, committed_at: Duration, )
base.DeserializeChangesCore(reader, committedAt): reads the changes of
the hand-written base class ServerSizeDependantVisual.fn on_brush_changing(&self)
fn on_brush_changed(&self)
fn on_shadow_changing(&self)
fn on_shadow_changed(&self)
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized(&self, _changed: SpriteVisualChangedFields)
Auto Trait Implementations§
impl !Freeze for ServerCompositionVisual
impl !RefUnwindSafe for ServerCompositionVisual
impl !Send for ServerCompositionVisual
impl !Sync for ServerCompositionVisual
impl !UnwindSafe for ServerCompositionVisual
impl Unpin for ServerCompositionVisual
impl UnsafeUnpin for ServerCompositionVisual
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