Skip to main content

Module server

Module server 

Source
Expand description

The server (render thread) side of the composition renderer.

Re-exports§

pub use dirty_rects::DebugEventsDirtyRectCollectorProxy;
pub use dirty_rects::IDirtyRectCollector;
pub use dirty_rects::IDirtyRectTracker;
pub use dirty_rects::MultiDirtyRectTracker;
pub use dirty_rects::RegionDirtyRectTracker;
pub use dirty_rects::SingleDirtyRectTracker;
pub use super::brushes::ServerCompositionSimpleContentBrush;
pub use super::brushes::ServerCompositionSimpleImageBrush;
pub use super::brushes::ServerCompositionConicGradientBrush;
pub use super::brushes::ServerCompositionGradientBrush;
pub use super::brushes::ServerCompositionLinearGradientBrush;
pub use super::brushes::ServerCompositionRadialGradientBrush;
pub use super::brushes::ServerCompositionSolidColorBrush;
pub use super::brushes::paint_composition_brush;
pub use super::brushes::surface_brush_content_rect;
pub use super::brushes::ServerCompositionSurfaceBrush;
pub use super::brushes::ServerCompositionBackdropBrush;
pub use super::brushes::ServerCompositionEffectBrush;
pub use super::brushes::nine_grid_rects;
pub use super::brushes::NineGridEdges;
pub use super::brushes::ServerCompositionMaskBrush;
pub use super::brushes::ServerCompositionNineGridBrush;
pub use super::brushes::NINE_GRID_CENTER;
pub use server_object::IAnimatedServerObject;
pub use server_object::IServerObject;
pub use server_object::ServerExpressionObject;
pub use server_object::ServerObject;
pub use server_object::ServerObjectId;
pub use server_render_resource::IServerRenderResource;
pub use server_render_resource::IServerRenderResourceHost;
pub use server_render_resource::IServerRenderResourceObserver;
pub use server_render_resource::ServerRenderResource;
pub use server_render_resource::ServerRenderResourceCore;
pub use server_render_resource::SimpleServerRenderResource;

Modules§

dirty_rects
Dirty rectangle tracking for the server-side compositor.

Structs§

BatchQueue
The queue of committed batches: the one point where data passes from the UI-thread compositor to the server compositor.
CompositionClipShape
The area a composition clip leaves visible, in the coordinates of the visual it is set on: a rectangle (rounded for a rectangle clip) or, for a geometric clip, a geometry in the space of the clip, and the transform of the clip.
CompositionProperty
The identity of a property of a server-side composition object: what animations, expressions and change notifications refer to.
CompositionPropertyOf
A CompositionProperty with typed access to its field (upstream CompositionProperty<T>).
CompositionShapePen
The pen a sprite shape strokes its geometry with, made from the stroke members of the shape when it is drawn.
CompositionTargetOverlays
The debug overlays of a composition target: the frame counter and the time graphs.
CompositorDrawingContextProxy
A drawing context that forwards to another one, postponing state changes until they are needed and applying an optional post transform.
CompositorLock
A lock that the thread holding it may enter again (lock in C#).
CompositorLockGuard
Leaves the lock when dropped.
CompositorPools
The object pools of a server compositor.
DiagnosticGlyphRun
A glyph run as needed by DiagnosticTextRenderer.
DiagnosticTextRenderer
A class used to render diagnostic strings (only!), with caching of ASCII glyph runs. Digits are laid out in equal-width cells so rapidly changing values do not make the text jump around.
DrawingSurfaceUpdateError
The error of an update that cannot proceed (InvalidOperationException).
FpsCounter
An FPS counter helper that can draw itself on the render thread. The labels are shaped once and the changing numbers are drawn in a fixed digit grid, so a frame neither formats nor measures any text.
FrameTimeGraph
Represents a simple time graph for diagnostics purpose, used to show layout and render times.
GlyphTypefaceDiagnosticGlyphRunSource
Builds the glyph runs of a DiagnosticTextRenderer from a glyph typeface and a font rendering em size, as the C# constructor does.
LightAttenuation
The attenuation of a point or spot light with the distance.
LightColor
An amount of light per channel: 0 is none, 1 is full.
LightMap
The lights that reach a visual, each with the transform from the space of the visual to the space of the light.
LightingMaterial
How a surface reflects the lights: the amounts of the ambient, diffuse and specular lighting and the shininess of the specular highlight (the members of the scene lighting effect of WinUI).
LitContent
The lighting of the own content of a visual in the render walk: begun before the content is drawn, ended after it (before the children).
LockBound
A value confined to the compositor lock: an object of the server side that is not part of the graph of the server compositor.
LockedServerCompositor
The server compositor behind its lock.
ReadbackData
What the UI thread reads back from a server visual.
ReadbackIndices
A helper class used to manage the current slots for writing data from the render thread and reading it from the UI thread. Used mostly by hit-testing which needs to know the last transform of the visual
ReadbackWriteScope
A write in progress, started by ReadbackIndices::begin_write.
ServerAmbientLight
The server-side counterpart of an AmbientLight.
ServerCompositionBitmapCache
Server-side counterpart of CompositionBitmapCache.
ServerCompositionCacheMode
Server-side counterpart of CompositionBitmapCache.
ServerCompositionContainerShape
The server-side counterpart of a CompositionContainerShape.
ServerCompositionContainerVisual
The content of a plain container visual: nothing of its own.
ServerCompositionCustomVisual
The content of the server-side counterpart of a CompositionCustomVisual: a container visual that draws through its handler.
ServerCompositionDrawListVisual
Server-side counterpart of CompositionDrawListVisual.
ServerCompositionDrawingSurface
The server-side counterpart of a CompositionDrawingSurface: a surface whose content is a snapshot of an imported GPU image.
ServerCompositionEllipseGeometry
The server-side counterpart of a CompositionEllipseGeometry.
ServerCompositionExperimentalAcrylicVisual
Server-side counterpart of CompositionExperimentalAcrylicVisual: a draw list visual that draws an acrylic rectangle below its content.
ServerCompositionGradientStop
The server-side counterpart of a CompositionGradientStop.
ServerCompositionLineGeometry
The server-side counterpart of a CompositionLineGeometry.
ServerCompositionPathGeometry
The server-side counterpart of a CompositionPathGeometry.
ServerCompositionPropertySet
The server-side counterpart of a live CompositionPropertySet: its entries, animatable, readable by the expressions that refer to the set.
ServerCompositionRectangleGeometry
The server-side counterpart of a CompositionRectangleGeometry.
ServerCompositionRoundedRectangleGeometry
The server-side counterpart of a CompositionRoundedRectangleGeometry.
ServerCompositionShapeCollection
The server-side counterpart of a CompositionShapeCollection.
ServerCompositionSimpleBrush
The server-side counterpart of a mutable brush: the properties all brushes share.
ServerCompositionSimpleConicGradientBrush
The server-side counterpart of a mutable conic gradient brush.
ServerCompositionSimpleGeometry
The server-side counterpart of a geometry object: the platform geometry the object currently resolves to.
ServerCompositionSimpleGradientBrush
The gradient part of the server-side gradient brushes: the brush properties, the stops and the spread method.
ServerCompositionSimpleLinearGradientBrush
The server-side counterpart of a mutable linear gradient brush.
ServerCompositionSimpleRadialGradientBrush
The server-side counterpart of a mutable radial gradient brush.
ServerCompositionSimpleSolidColorBrush
The server-side counterpart of a mutable solid color brush.
ServerCompositionSimpleTileBrush
The server-side counterpart of a mutable tile brush.
ServerCompositionSimpleTransform
The server-side counterpart of a mutable transform.
ServerCompositionSolidColorVisual
Server-side counterpart of CompositionSolidColorVisual.
ServerCompositionSpriteShape
The server-side counterpart of a CompositionSpriteShape.
ServerCompositionSurfaceChanged
The Changed delegate of a server-side surface: the callbacks of the visuals that show it.
ServerCompositionSurfaceVisual
Server-side counterpart of CompositionSurfaceVisual.
ServerCompositionTarget
Server-side counterpart of the CompositionTarget. That’s the place where we update visual transforms, track dirty rects and actually do rendering.
ServerCompositionViewBox
The server-side counterpart of a CompositionViewBox.
ServerCompositionVisual
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.
ServerCompositionVisualCache
The bitmap cache of a visual: an offscreen layer the subtree of the visual is rendered into, redrawn only where it changed.
ServerCompositionVisualCollection
Server-side counterpart of the children collection of a visual.
ServerCompositionVisualSurface
The server-side counterpart of a CompositionVisualSurface: a live image of the subtree of a visual.
ServerCompositor
Server-side counterpart of the compositor: owns the server objects, applies the batches committed by the UI thread and renders.
ServerCompositorAnimations
The clock items and the dirty animated objects of a server compositor.
ServerDistantLight
The server-side counterpart of a DistantLight.
ServerDropShadow
The server-side counterpart of a DropShadow.
ServerExpressionObject
An animatable server object as an expression reads it: the target of an animation, or an object an animation refers to through a reference parameter (upstream passes the ServerObject itself, which implements IExpressionObject).
ServerGeometricClip
The server-side counterpart of a GeometricClip.
ServerInsetClip
The server-side counterpart of an InsetClip.
ServerLayerVisual
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.
ServerLightState
The bookkeeping of a light: the observer of its changes and the targets it lit, whose subtrees are drawn again when the light changes.
ServerList
A server-side list container capable of receiving changes from the UI thread. Right now it’s quite dumb since it always receives the full list.
ServerLoadedImageSurface
The server-side counterpart of a LoadedImageSurface: a surface whose content is a bitmap given when it is created.
ServerObject
Server-side CompositionObject counterpart. Is responsible for animation activation and invalidation.
ServerObjectAnimations
The animations of a server object and the animations of other objects that depend on its properties.
ServerObjectId
Identifies a server-side object within its server compositor.
ServerPointLight
The server-side counterpart of a PointLight.
ServerRectangleClip
The server-side counterpart of a RectangleClip.
ServerRedirectVisual
Server-side counterpart of a RedirectVisual: draws the subtree of its source in its own coordinates, under its children.
ServerRenderResource
The base of the animatable server-side render resources (upstream ServerRenderResource, a ServerObject), as a part the resource classes embed: the animation support of the server object, the resource core and the handle of the object as a render resource.
ServerRenderResourceCore
The shared implementation of render resources: change coalescing and the reference-counted observer list.
ServerResourceRef
A reference-typed property value of a server object that may be a server-side render resource (a brush or a transform): the value as its media interface, and the render resource behind it when it is one.
ServerShapeVisual
Server-side counterpart of a ShapeVisual: its shapes, through its view box, clipped to its size, then its children.
ServerSizeDependantVisual
The behaviour of a visual whose content covers its size: the base of the solid color and surface visuals.
ServerSpotLight
The server-side counterpart of a SpotLight.
ServerSpriteVisual
Server-side counterpart of a SpriteVisual: the shadow of its rectangle, of its mask or of the alpha of its brush (see ServerDropShadow::render_under_rect and ServerDropShadow::render_shadow_of), then its brush over (0, 0, size), then its children.
ServerValueChange
One assignment of a property field, in the form SetValue(prop, ref field, value) takes it upstream: the class decides what else happens around the assignment.
ServerVisualRenderContext
What a visual renders its own content with.
ServerVisualUnorderedCollection
The server-side counterpart of a VisualUnorderedCollection: a render resource, so a change of the collection invalidates the light that holds it.
ShapedText
A piece of text shaped once by DiagnosticTextRenderer::shape.
SimpleServerRenderResource
The base of the server-side render resources that are not animatable (upstream SimpleServerRenderResource), as a part the resource classes embed: the compositor, the resource core and the handle of the object as a render resource.
StackPool
A pool of stacks, so that tree walks do not allocate.
TreeWalkerFrame
A position of the tree walk: a container and the index of its child to visit next.
ViewBoxMapping
How a view box maps shape coordinates onto the area of a visual.
VisualReadback
The two readback slots of a visual.

Enums§

LightSource
A light in its coordinate space, on the plane z = 0 of that space.

Constants§

LIGHT_MAP_CELL
The size of a cell of the light map grid of LightMap::size_for, in units (the grid of 0.4; the render walk samples the map by device pixels, LightMap::size_for_scale).
LIGHT_MAP_MAX_CELLS
The largest number of cells of the grid of LightMap::size_for along a side.
LIGHT_MAP_MAX_SAMPLES
The largest number of samples of a light map along a side.
LIGHT_MAP_MAX_SCALE
The largest factor of a light map: a light up to this many times the full light brightens the content.
LIGHT_MAP_SAMPLE_SPACING
The distance, in device pixels, between two samples of a light map.
MAX_BACKDROP_DEPTH
How deep a backdrop may be drawn inside another backdrop: a backdrop of a deeper level is empty.
SCENE_LIGHTING_DISTANCE_UNIT
The unit of the distances of the attenuation of the scene lighting effect, in device independent pixels.

Traits§

AsServerRenderResource
The render resource behind a property value, when it is one.
IAnimatedServerObject
A server object that supports animated properties: what upstream’s abstract ServerObject is to its subclasses.
IDiagnosticGlyphRunSource
The seam between DiagnosticTextRenderer and the text stack.
IServerAnimatedPropertyHost
What the generated property block of an animatable server object needs from the object that embeds it (the animation members of upstream ServerObject).
IServerClockItem
Something the server compositor advances once per frame.
IServerCompositionGeometry
What the shapes and clips need from a server-side geometry.
IServerCompositionLight
What every server-side light has: the properties of CompositionLight, where it shines from and what it lights.
IServerCompositionSurface
Server-side counterpart of a composition surface: something that provides a bitmap to the surface visuals that show it.
IServerObject
The base contract of every server-side object (upstream SimpleServerObject).
IServerPropertyHost
What a generated server property block needs from the object that embeds it (upstream SimpleServerObject).
IServerRenderResource
A server-side render resource: a brush, pen, geometry, transform or render data whose changes invalidate the objects that use it.
IServerRenderResourceHost
A render resource that owns a ServerRenderResourceCore.
IServerRenderResourceObserver
Something that is notified when a render resource it depends on is invalidated.
IServerVisualContent
What a concrete server visual class adds to ServerCompositionVisual: its own properties and its overrides of the virtual members.
ServerPropertyValue
Equality of property values as the generated setters need it.

Functions§

brush_light_ids
The ids of the XAML lights that target the XAML brush being painted (empty outside a XAML brush).
composition_transform
The transform of a WinUI clip or brush from its own properties, in the space of an area of size: the anchor point is relative to the size, then the transform matrix, the scale and the rotation about the center point and the offset apply, as for a visual. None for the identity.
distant_light_incidence
N.L of a flat visual facing +Z for a distant light shining in direction: -z / |direction|, 0 for a light from behind or a zero direction.
draw_backdrop
Draws the backdrop of the visual being painted into rect (in the coordinates of canvas): the tree of the innermost render, from its root, with the transform the render began with, cut to rect, up to (and without) the visual. Returns whether anything was drawn.
drop_shadow_effect
The drop shadow of the alpha of pushed content that draws shadow: its offset (X and Y), blur radius, colour and opacity. The offset is the one of the shadow, outside the plane of any visual (drop_shadow_effect_in projects it into the plane of a visual).
drop_shadow_effect_in
The drop shadow of the alpha of pushed content that draws shadow for visual: its offset in the plane of the visual (ServerDropShadow::plane_offset), blur radius, colour and opacity.
inset_rect
The rectangle an inset clip leaves visible on an area of size: (left, top, size.x - right, size.y - bottom), empty when the insets overlap.
invalidate_lights_with_moved_spaces
Draws again what the lights whose CoordinateSpace visual moved (it, or an ancestor, changed its transform) since the last check light: the position of such a light moved with its space. Called by the composition targets after their update; returns whether a light drew something again, so the target collects the dirty areas once more.
light_map_of
The lights that reach visual, as a light map in the coordinates of the visual; None when no enabled light reaches it.
paint_scene_lighting
Paints the lighting of a scene lighting effect over rect (in the coordinates of canvas) for the visual being drawn and the XAML brush being painted: an opaque light map, black where no light shines.
painting_visual
The visual whose own content is being drawn.
platform_geometry_of
The trimmed platform geometry of object (a server-side geometry), if it is one and there is something to draw.
point_light_incidence
N.L of a flat visual facing +Z at point for a light at position: z / distance, 0 for a light at or below the plane. Also the distance.
props_of
The generated property block P embedded in a server object.
read_resource
Reads a resource reference from a batch and resolves it.
read_server_object
Reads a reference to a server object from a batch and resolves it.
render_shapes
Draws shapes (server-side sprite and container shapes) in order onto canvas: parent is the transform from the space of the shapes to the space of the visual (the view box, the containers), base the transform of the canvas for the visual. The transform of the canvas is base again afterwards.
resolve_resource
Resolves a resource reference read from a batch: a value is taken as it is, the id of a server object is looked up and viewed through cast.
scene_light_map
The lights a scene lighting effect painted in visual receives: the composition lights that target the visual (or an ancestor), and the lights of XAML lights whose id is one of brush_light_ids and whose element holds the visual. The light map is in the coordinates of the visual, with the attenuation in units of SCENE_LIGHTING_DISTANCE_UNIT. Every such light, enabled or not, remembers the visual, which it draws again when it changes.
server_geometry_of
The server-side geometry behind object, if it is one.
shape_transform
The transform of a shape in the space of its parent, from the members of CompositionShape; None for the identity.
spot_light_cone
Where point is in the cones of a spot light at position shining in direction: 1 inside the inner cone, 0 outside the outer cone, a smooth step between. The angles are from the direction to the edge of the cone; an inner angle wider than the outer one is the outer one.
trim_geometry
view_box_mapping
Maps the view box (offset, size) onto area: the view box is sized by stretch and placed by the alignment ratios, as a surface brush lays out its surface (see surface_brush_content_rect). None when the view box or the area is empty.

Type Aliases§

CompositorClock
The source of the compositor clock: time elapsed since an arbitrary origin. It is read from both sides of the transport; like the server compositor it is confined to the compositor’s thread for now, because the dispatcher’s clock is.
RenderSurfaces
Returns the current platform surfaces of a composition target.