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§
- Batch
Queue - The queue of committed batches: the one point where data passes from the UI-thread compositor to the server compositor.
- Composition
Clip Shape - 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.
- Composition
Property - The identity of a property of a server-side composition object: what animations, expressions and change notifications refer to.
- Composition
Property Of - A
CompositionPropertywith typed access to its field (upstreamCompositionProperty<T>). - Composition
Shape Pen - The pen a sprite shape strokes its geometry with, made from the stroke members of the shape when it is drawn.
- Composition
Target Overlays - The debug overlays of a composition target: the frame counter and the time graphs.
- Compositor
Drawing Context Proxy - A drawing context that forwards to another one, postponing state changes until they are needed and applying an optional post transform.
- Compositor
Lock - A lock that the thread holding it may enter again (
lockin C#). - Compositor
Lock Guard - Leaves the lock when dropped.
- Compositor
Pools - The object pools of a server compositor.
- Diagnostic
Glyph Run - A glyph run as needed by
DiagnosticTextRenderer. - Diagnostic
Text Renderer - 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.
- Drawing
Surface Update Error - 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.
- Frame
Time Graph - Represents a simple time graph for diagnostics purpose, used to show layout and render times.
- Glyph
Typeface Diagnostic Glyph RunSource - Builds the glyph runs of a
DiagnosticTextRendererfrom a glyph typeface and a font rendering em size, as the C# constructor does. - Light
Attenuation - The attenuation of a point or spot light with the distance.
- Light
Color - An amount of light per channel: 0 is none, 1 is full.
- Light
Map - The lights that reach a visual, each with the transform from the space of the visual to the space of the light.
- Lighting
Material - 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).
- Lock
Bound - A value confined to the compositor lock: an object of the server side that is not part of the graph of the server compositor.
- Locked
Server Compositor - The server compositor behind its lock.
- Readback
Data - What the UI thread reads back from a server visual.
- Readback
Indices - 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
- Readback
Write Scope - A write in progress, started by
ReadbackIndices::begin_write. - Server
Ambient Light - The server-side counterpart of an
AmbientLight. - Server
Composition Bitmap Cache - Server-side counterpart of
CompositionBitmapCache. - Server
Composition Cache Mode - Server-side counterpart of
CompositionBitmapCache. - Server
Composition Container Shape - The server-side counterpart of a
CompositionContainerShape. - Server
Composition Container Visual - The content of a plain container visual: nothing of its own.
- Server
Composition Custom Visual - The content of the server-side counterpart of a
CompositionCustomVisual: a container visual that draws through its handler. - Server
Composition Draw List Visual - Server-side counterpart of
CompositionDrawListVisual. - Server
Composition Drawing Surface - The server-side counterpart of a
CompositionDrawingSurface: a surface whose content is a snapshot of an imported GPU image. - Server
Composition Ellipse Geometry - The server-side counterpart of a
CompositionEllipseGeometry. - Server
Composition Experimental Acrylic Visual - Server-side counterpart of
CompositionExperimentalAcrylicVisual: a draw list visual that draws an acrylic rectangle below its content. - Server
Composition Gradient Stop - The server-side counterpart of a
CompositionGradientStop. - Server
Composition Line Geometry - The server-side counterpart of a
CompositionLineGeometry. - Server
Composition Path Geometry - The server-side counterpart of a
CompositionPathGeometry. - Server
Composition Property Set - The server-side counterpart of a live
CompositionPropertySet: its entries, animatable, readable by the expressions that refer to the set. - Server
Composition Rectangle Geometry - The server-side counterpart of a
CompositionRectangleGeometry. - Server
Composition Rounded Rectangle Geometry - The server-side counterpart of a
CompositionRoundedRectangleGeometry. - Server
Composition Shape Collection - The server-side counterpart of a
CompositionShapeCollection. - Server
Composition Simple Brush - The server-side counterpart of a mutable brush: the properties all brushes share.
- Server
Composition Simple Conic Gradient Brush - The server-side counterpart of a mutable conic gradient brush.
- Server
Composition Simple Geometry - The server-side counterpart of a geometry object: the platform geometry the object currently resolves to.
- Server
Composition Simple Gradient Brush - The gradient part of the server-side gradient brushes: the brush properties, the stops and the spread method.
- Server
Composition Simple Linear Gradient Brush - The server-side counterpart of a mutable linear gradient brush.
- Server
Composition Simple Radial Gradient Brush - The server-side counterpart of a mutable radial gradient brush.
- Server
Composition Simple Solid Color Brush - The server-side counterpart of a mutable solid color brush.
- Server
Composition Simple Tile Brush - The server-side counterpart of a mutable tile brush.
- Server
Composition Simple Transform - The server-side counterpart of a mutable transform.
- Server
Composition Solid Color Visual - Server-side counterpart of
CompositionSolidColorVisual. - Server
Composition Sprite Shape - The server-side counterpart of a
CompositionSpriteShape. - Server
Composition Surface Changed - The
Changeddelegate of a server-side surface: the callbacks of the visuals that show it. - Server
Composition Surface Visual - Server-side counterpart of
CompositionSurfaceVisual. - Server
Composition Target - Server-side counterpart of the
CompositionTarget. That’s the place where we update visual transforms, track dirty rects and actually do rendering. - Server
Composition View Box - The server-side counterpart of a
CompositionViewBox. - Server
Composition Visual - Server-side
CompositionVisualcounterpart. Is responsible for computing the transformation matrix, for applying various visual properties before calling visual-specific drawing code and for notifying theServerCompositionTargetfor new dirty rects. - Server
Composition Visual Cache - The bitmap cache of a visual: an offscreen layer the subtree of the visual is rendered into, redrawn only where it changed.
- Server
Composition Visual Collection - Server-side counterpart of the children collection of a visual.
- Server
Composition Visual Surface - The server-side counterpart of a
CompositionVisualSurface: a live image of the subtree of a visual. - Server
Compositor - Server-side counterpart of the compositor: owns the server objects, applies the batches committed by the UI thread and renders.
- Server
Compositor Animations - The clock items and the dirty animated objects of a server compositor.
- Server
Distant Light - The server-side counterpart of a
DistantLight. - Server
Drop Shadow - The server-side counterpart of a
DropShadow. - Server
Expression Object - 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
ServerObjectitself, which implementsIExpressionObject). - Server
Geometric Clip - The server-side counterpart of a
GeometricClip. - Server
Inset Clip - The server-side counterpart of an
InsetClip. - Server
Layer Visual - Server-side counterpart of a
LayerVisual: its children are composed into an offscreen layer (push_layerover the bounds of the subtree), which the opacity of the visual applies to as a whole. - Server
Light State - The bookkeeping of a light: the observer of its changes and the targets it lit, whose subtrees are drawn again when the light changes.
- Server
List - 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.
- Server
Loaded Image Surface - The server-side counterpart of a
LoadedImageSurface: a surface whose content is a bitmap given when it is created. - Server
Object - Server-side
CompositionObjectcounterpart. Is responsible for animation activation and invalidation. - Server
Object Animations - The animations of a server object and the animations of other objects that depend on its properties.
- Server
Object Id - Identifies a server-side object within its server compositor.
- Server
Point Light - The server-side counterpart of a
PointLight. - Server
Rectangle Clip - The server-side counterpart of a
RectangleClip. - Server
Redirect Visual - Server-side counterpart of a
RedirectVisual: draws the subtree of its source in its own coordinates, under its children. - Server
Render Resource - The base of the animatable server-side render resources (upstream
ServerRenderResource, aServerObject), 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. - Server
Render Resource Core - The shared implementation of render resources: change coalescing and the reference-counted observer list.
- Server
Resource Ref - 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.
- Server
Shape Visual - Server-side counterpart of a
ShapeVisual: its shapes, through its view box, clipped to its size, then its children. - Server
Size Dependant Visual - The behaviour of a visual whose content covers its size: the base of the solid color and surface visuals.
- Server
Spot Light - The server-side counterpart of a
SpotLight. - Server
Sprite Visual - Server-side counterpart of a
SpriteVisual: the shadow of its rectangle, of its mask or of the alpha of its brush (seeServerDropShadow::render_under_rectandServerDropShadow::render_shadow_of), then its brush over(0, 0, size), then its children. - Server
Value Change - 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. - Server
Visual Render Context - What a visual renders its own content with.
- Server
Visual Unordered Collection - The server-side counterpart of a
VisualUnorderedCollection: a render resource, so a change of the collection invalidates the light that holds it. - Shaped
Text - A piece of text shaped once by
DiagnosticTextRenderer::shape. - Simple
Server Render Resource - 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. - Stack
Pool - A pool of stacks, so that tree walks do not allocate.
- Tree
Walker Frame - A position of the tree walk: a container and the index of its child to visit next.
- View
BoxMapping - How a view box maps shape coordinates onto the area of a visual.
- Visual
Readback - The two readback slots of a visual.
Enums§
- Light
Source - A light in its coordinate space, on the plane
z = 0of 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_foralong 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§
- AsServer
Render Resource - The render resource behind a property value, when it is one.
- IAnimated
Server Object - A server object that supports animated properties: what upstream’s
abstract
ServerObjectis to its subclasses. - IDiagnostic
Glyph RunSource - The seam between
DiagnosticTextRendererand the text stack. - IServer
Animated Property Host - What the generated property block of an animatable server object needs
from the object that embeds it (the animation members of upstream
ServerObject). - IServer
Clock Item - Something the server compositor advances once per frame.
- IServer
Composition Geometry - What the shapes and clips need from a server-side geometry.
- IServer
Composition Light - What every server-side light has: the properties of
CompositionLight, where it shines from and what it lights. - IServer
Composition Surface - Server-side counterpart of a composition surface: something that provides a bitmap to the surface visuals that show it.
- IServer
Object - The base contract of every server-side object (upstream
SimpleServerObject). - IServer
Property Host - What a generated server property block needs from the object that embeds
it (upstream
SimpleServerObject). - IServer
Render Resource - A server-side render resource: a brush, pen, geometry, transform or render data whose changes invalidate the objects that use it.
- IServer
Render Resource Host - A render resource that owns a
ServerRenderResourceCore. - IServer
Render Resource Observer - Something that is notified when a render resource it depends on is invalidated.
- IServer
Visual Content - What a concrete server visual class adds to
ServerCompositionVisual: its own properties and its overrides of the virtual members. - Server
Property Value - 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.Nonefor the identity. - distant_
light_ incidence N.Lof a flat visual facing +Z for a distant light shining indirection:-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 ofcanvas): the tree of the innermost render, from its root, with the transform the render began with, cut torect, 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_inprojects it into the plane of a visual). - drop_
shadow_ effect_ in - The drop shadow of the alpha of pushed content that draws
shadowforvisual: 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
CoordinateSpacevisual 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;Nonewhen no enabled light reaches it. - paint_
scene_ lighting - Paints the lighting of a scene lighting effect over
rect(in the coordinates ofcanvas) 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.Lof a flat visual facing +Z atpointfor a light atposition:z / distance, 0 for a light at or below the plane. Also the distance.- props_
of - The generated property block
Pembedded 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 ontocanvas:parentis the transform from the space of the shapes to the space of the visual (the view box, the containers),basethe transform of the canvas for the visual. The transform of the canvas isbaseagain 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
visualreceives: the composition lights that target the visual (or an ancestor), and the lights of XAML lights whose id is one ofbrush_light_idsand whose element holds the visual. The light map is in the coordinates of the visual, with the attenuation in units ofSCENE_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;Nonefor the identity. - spot_
light_ cone - Where
pointis in the cones of a spot light atpositionshining indirection: 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)ontoarea: the view box is sized bystretchand placed by the alignment ratios, as a surface brush lays out its surface (seesurface_brush_content_rect).Nonewhen the view box or the area is empty.
Type Aliases§
- Compositor
Clock - 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.
- Render
Surfaces - Returns the current platform surfaces of a composition target.