Skip to main content

ServerCompositionVisual

Struct ServerCompositionVisual 

Source
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

Source

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

Source§

impl ServerCompositionVisual

Source§

impl ServerCompositionVisual

Source

pub fn get_readback(&self, reader_revision: u64) -> Option<ReadbackData>

Source

pub fn update_readback(&self, writer_revision: u64, reader_revision: u64)

Source§

impl ServerCompositionVisual

Source

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

Source

pub fn update_root( self: &Rc<Self>, tracker: Rc<dyn IDirtyRectCollector>, transform: Matrix, clip: LtrbRect, )

Source§

impl ServerCompositionVisual

Source

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.

Source

pub fn weak(&self) -> Weak<ServerCompositionVisual>

A weak handle of the visual.

Source

pub fn compositor(&self) -> Option<Rc<ServerCompositor>>

The compositor of the visual, while it is alive.

Source

pub fn object(&self) -> &ServerObject

The ServerObject part: activation and animations.

Source

pub fn activate(&self)

Source

pub fn deactivate(&self)

Source

pub fn content(&self) -> &dyn IServerVisualContent

The concrete class of the visual.

Source

pub fn content_as<T: IServerVisualContent>(&self) -> Option<&T>

The concrete class of the visual as T.

Source

pub fn children(&self) -> Option<&Rc<ServerCompositionVisualCollection>>

Source

pub fn cache(&self) -> Option<Rc<ServerCompositionVisualCache>>

Source

pub fn visual_props(&self) -> &ServerCompositionVisualProps

The generated properties of the visual class.

Source

pub fn root(&self) -> Option<Rc<ServerCompositionTarget>>

Source

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

Source

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

Source

pub fn cache_mode(&self) -> Option<Rc<ServerCompositionBitmapCache>>

Source

pub fn visible(&self) -> bool

Source

pub fn opacity(&self) -> f32

Source

pub fn clip(&self) -> Option<Arc<dyn IGeometryImpl>>

Source

pub fn clip_to_bounds(&self) -> bool

Source

pub fn offset(&self) -> Vector3D

Source

pub fn translation(&self) -> Vector3D

Source

pub fn size(&self) -> Vector

Source

pub fn anchor_point(&self) -> Vector

Source

pub fn center_point(&self) -> Vector3D

Source

pub fn rotation_angle(&self) -> f32

Source

pub fn orientation(&self) -> Quaternion

Source

pub fn scale(&self) -> Vector3D

Source

pub fn transform_matrix(&self) -> Matrix

Source

pub fn adorner_is_clipped(&self) -> bool

Source

pub fn opacity_mask_brush(&self) -> Option<Rc<dyn IBrush>>

Source

pub fn effect(&self) -> Option<Arc<dyn IImmutableEffect>>

Source

pub fn render_options(&self) -> RenderOptions

Source

pub fn text_options(&self) -> TextOptions

Source

pub fn on_cache_mode_state_changed(&self)

Source

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

Source§

fn server_object(&self) -> &ServerObject

The embedded ServerObject part.
Source§

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

The composition property with the given name, if the class has one.
Source§

fn as_server_object_dyn(&self) -> &dyn IServerObject

The object as the base contract (an explicit upcast).
Source§

impl IExpressionObject for ServerCompositionVisual

Source§

fn get_property(&self, name: &str) -> ExpressionVariant

Gets the value of the property with the given name; Invalid when there is no such property.
Source§

fn key(&self) -> ExpressionObjectKey

The identity of the object, used to track the objects an expression depends on (see 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

Source§

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)

The tail of 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)

An animation wrote a new value into the field of property.
Source§

impl IServerObject for ServerCompositionVisual

Source§

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

Reads the changes of the object from a batch.
Source§

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

The generated property block of the given type embedded in the object, if it has one. A class that embeds generated properties forwards to their find_props; composition properties locate their fields through it.
Source§

fn as_animated(self: Rc<Self>) -> Option<Rc<dyn IAnimatedServerObject>>

The object as an animatable object, if it is one.
Source§

fn as_any(&self) -> &dyn Any

Source§

fn into_any_rc(self: Rc<Self>) -> Rc<dyn Any>

Source§

fn values_invalidated(&self)

Called after a group of values of the object changed.
Source§

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

Applies the changes of the object from a batch.
Source§

fn as_render_resource(self: Rc<Self>) -> Option<Rc<dyn IServerRenderResource>>

The object as a render resource, if it is one.
Source§

fn as_brush(self: Rc<Self>) -> Option<Rc<dyn IBrush>>

The object as a brush, if it is a server-side brush.
Source§

fn as_pen(self: Rc<Self>) -> Option<Rc<dyn IPen>>

The object as a pen, if it is a server-side pen.
Source§

fn as_render_data_geometry( self: Rc<Self>, ) -> Option<Rc<dyn IRenderDataGeometry>>

The object as a geometry usable by render data, if it is a server-side geometry.
Source§

fn as_transform(self: Rc<Self>) -> Option<Rc<dyn ITransform>>

The object as a transform, if it is a server-side transform.
Source§

fn as_gradient_stop(self: Rc<Self>) -> Option<Rc<dyn IGradientStop>>

The object as a gradient stop, if it is a server-side gradient stop.
Source§

fn as_surface(self: Rc<Self>) -> Option<Rc<dyn IServerCompositionSurface>>

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

impl IServerPropertyHost for ServerCompositionVisual

Source§

fn server_compositor(&self) -> Option<Rc<ServerCompositor>>

The compositor of the object, while it is alive. Used to resolve the server objects a batch refers to.
Source§

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

Source§

impl ServerCompositionContainerVisualHooks for ServerCompositionVisual

Source§

impl ServerCompositionExperimentalAcrylicVisualHooks for ServerCompositionVisual

Source§

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.
Source§

fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)

Source§

fn on_fields_deserialized( &self, _changed: CompositionExperimentalAcrylicVisualChangedFields, )

Source§

fn on_material_changed(&self)

Source§

fn on_material_changing(&self)

Source§

fn on_corner_radius_changed(&self)

Source§

fn on_corner_radius_changing(&self)

Source§

impl ServerCompositionSolidColorVisualHooks for ServerCompositionVisual

Source§

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.
Source§

fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)

Source§

fn on_fields_deserialized( &self, _changed: CompositionSolidColorVisualChangedFields, )

Source§

impl ServerCompositionSurfaceVisualHooks for ServerCompositionVisual

Source§

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.
Source§

fn on_surface_changed(&self)

Source§

fn on_surface_changing(&self)

Source§

fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)

Source§

fn on_fields_deserialized( &self, _changed: CompositionSurfaceVisualChangedFields, )

Source§

impl ServerCompositionVisualHooks for ServerCompositionVisual

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.