pub struct ServerCompositionTarget { /* private fields */ }Expand description
Server-side counterpart of the CompositionTarget. That’s the place
where we update visual transforms, track dirty rects and actually do
rendering.
Implementations§
Source§impl ServerCompositionTarget
impl ServerCompositionTarget
Sourcepub fn new(
compositor: &Rc<ServerCompositor>,
surfaces: RenderSurfaces,
id: i64,
) -> Rc<ServerCompositionTarget>
pub fn new( compositor: &Rc<ServerCompositor>, surfaces: RenderSurfaces, id: i64, ) -> Rc<ServerCompositionTarget>
id is the identity of the target, allocated by the UI thread so
that it can match readback data against it.
pub fn compositor(&self) -> Option<Rc<ServerCompositor>>
pub fn dirty_rects(&self) -> &Rc<dyn IDirtyRectTracker>
pub fn id(&self) -> i64
pub fn debug_events(&self) -> Option<Arc<dyn ICompositionTargetDebugEvents>>
pub fn set_debug_events( &self, value: Option<Arc<dyn ICompositionTargetDebugEvents>>, )
pub fn rendered_visuals(&self) -> i32
pub fn visited_visuals(&self) -> i32
pub fn pixel_size(&self) -> PixelSize
Sourcepub fn is_waiting_for_ready_render_target(&self) -> bool
pub fn is_waiting_for_ready_render_target(&self) -> bool
Returns true if the target is enabled and has pending work but its render target was not ready.
Sourcepub fn is_waiting_for_render_loop_wakeup(&self) -> bool
pub fn is_waiting_for_render_loop_wakeup(&self) -> bool
Returns true if the target’s render target is waiting for a render loop wakeup (i.e. the platform will call Wakeup() when ready, no need to keep polling).
pub fn root(&self) -> Option<Rc<ServerCompositionVisual>>
pub fn is_enabled(&self) -> bool
pub fn debug_overlays(&self) -> RendererDebugOverlays
pub fn last_layout_pass_timing(&self) -> LayoutPassTiming
pub fn scaling(&self) -> f64
pub fn size(&self) -> Size
pub fn transparency_level(&self) -> CompositionTransparencyLevel
pub fn platform_specific_scene_info(&self) -> Option<Arc<dyn Any + Send + Sync>>
pub fn update( self: &Rc<Self>, diagnostics_compositor_global_update_elapsed_time: Duration, )
pub fn render(self: &Rc<Self>)
pub fn request_update(&self)
pub fn reset_render_target(&self)
pub fn add_visual(&self, visual: &Rc<ServerCompositionVisual>)
pub fn remove_visual(&self, visual: &Rc<ServerCompositionVisual>)
pub fn request_full_redraw(&self)
Trait Implementations§
Source§impl IAnimatedServerObject for ServerCompositionTarget
impl IAnimatedServerObject for ServerCompositionTarget
Source§fn server_object(&self) -> &ServerObject
fn server_object(&self) -> &ServerObject
The embedded
ServerObject part.Source§fn as_server_object_dyn(&self) -> &dyn IServerObject
fn as_server_object_dyn(&self) -> &dyn IServerObject
The object as the base contract (an explicit upcast).
Source§fn get_composition_property(
&self,
_field_name: &str,
) -> Option<&'static CompositionProperty>
fn get_composition_property( &self, _field_name: &str, ) -> Option<&'static CompositionProperty>
The composition property with the given name, if the class has one.
Source§impl IServerAnimatedPropertyHost for ServerCompositionTarget
impl IServerAnimatedPropertyHost for ServerCompositionTarget
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)
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)
fn notify_animated_value_changed(&self, _property: &'static CompositionProperty)
An animation wrote a new value into the field of
property.Source§impl IServerObject for ServerCompositionTarget
impl IServerObject for ServerCompositionTarget
Source§fn deserialize_changes_core(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
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>
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>>
fn as_animated(self: Rc<Self>) -> Option<Rc<dyn IAnimatedServerObject>>
The object as an animatable object, if it is one.
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)
Called after a group of values of the object changed.
Source§fn deserialize_changes(
&self,
reader: &mut BatchStreamReader<'_>,
committed_at: Duration,
)
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>>
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>>
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>>
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>>
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>>
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>>
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>>
fn as_surface(self: Rc<Self>) -> Option<Rc<dyn IServerCompositionSurface>>
The object as a composition surface, if it is one.
Source§impl IServerPropertyHost for ServerCompositionTarget
impl IServerPropertyHost for ServerCompositionTarget
Source§fn server_compositor(&self) -> Option<Rc<ServerCompositor>>
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<'_>,
)
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 ServerCompositionTargetHooks for ServerCompositionTarget
impl ServerCompositionTargetHooks for ServerCompositionTarget
fn deserialize_changes_extra(&self, _reader: &mut BatchStreamReader<'_>)
fn on_fields_deserialized(&self, _changed: CompositionTargetChangedFields)
fn on_is_enabled_changed(&self)
fn on_debug_overlays_changed(&self)
fn on_last_layout_pass_timing_changed(&self)
fn on_root_changed(&self)
fn on_root_changing(&self)
fn on_is_enabled_changing(&self)
fn on_debug_overlays_changing(&self)
fn on_last_layout_pass_timing_changing(&self)
fn on_scaling_changed(&self)
fn on_scaling_changing(&self)
fn on_size_changed(&self)
fn on_size_changing(&self)
fn on_transparency_level_changed(&self)
fn on_transparency_level_changing(&self)
fn on_platform_specific_scene_info_changed(&self)
fn on_platform_specific_scene_info_changing(&self)
Auto Trait Implementations§
impl !Freeze for ServerCompositionTarget
impl !RefUnwindSafe for ServerCompositionTarget
impl !Send for ServerCompositionTarget
impl !Sync for ServerCompositionTarget
impl !UnwindSafe for ServerCompositionTarget
impl Unpin for ServerCompositionTarget
impl UnsafeUnpin for ServerCompositionTarget
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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