Xui.Core.Canvas.Composition
Assembly: Xui.Core · C# declarations · Assembly overview
Types
class Node
A platform-independent retained composition element with identity, placement and children.
Applications declare composition through ICompositionContext.Group and GpuSurface. A retained context reconciles those declarations by key into nodes. A platform presenter maps each node to suitable resources: native views or layers, compositor visuals, GPU surfaces, or drawing replayed into a parent. A node does not require a native view or an intermediate bitmap. Content can remain unchanged while its placement and presentation are updated.
Immediate and export contexts can implement the same declarations without constructing this tree. SVG currently emits groups directly. iOS presents the retained tree using UIKit views, effect views and MTKView GPU surfaces. Android presents backed graphics groups through Java views and hardware display lists, with Vulkan presentation for GPU leaves. Windows currently draws groups immediately. Native visuals or offscreen GPU textures are possible backend strategies, not capabilities guaranteed by this base class. GPU surface support and the need for a portable fallback are reported by ICompositionContext.GpuSurface.
This is a rendering/composition model, not the Xui UI view tree. It does not supply layout, input routing, focus or accessibility semantics merely because a backend uses native views. Derived nodes own their content, children and any platform resources, released by overriding DisposeCore. The base provides presentation properties and an idempotent disposal entry point.
public abstract partial class Node
{
public ref struct Enumerator
{
public readonly Node Current { get; }
public bool MoveNext();
}
}
public abstract partial class Node
{
public virtual int Count { get; }
public virtual Node this[int index] { get; }
public Enumerator GetEnumerator();
}
public abstract partial class Node : IDisposable
{
public GroupOptions Options { get; }
public Rect RasterBounds { get; }
public AffineTransform Placement { get; }
public nfloat Scale { get; }
public bool Updating { get; }
public void Dispose();
protected virtual void DisposeCore();
}
int Node.Count
public virtual int Count { get; }
Number of visible children in back-to-front order. Leaf nodes return zero.
void Node.Dispose()
public void Dispose();
Releases the node's owned resources once, including derived content and children.
void Node.DisposeCore()
protected virtual void DisposeCore();
Overrides release their owned content, children and platform resources, then call base.
Enumerator Node.GetEnumerator()
public Enumerator GetEnumerator();
Enumerates visible children without allocating or boxing an enumerator.
Do not mutate the hierarchy during enumeration.
Node Node.this[int index]
public virtual Node this[int index] { get; }
Returns the visible child at the given index.
GroupOptions Node.Options
public GroupOptions Options { get; }
Stable sibling identity, effects, clipping and content-update declarations.
AffineTransform Node.Placement
public AffineTransform Placement { get; }
Resolved transform relative to the parent presentation surface.
Rect Node.RasterBounds
public Rect RasterBounds { get; }
Resolved content bounds used for drawing or native surface placement.
NFloat Node.Scale
public nfloat Scale { get; }
Device scale used to present the content.
bool Node.Updating
public bool Updating { get; }
Whether this frame requested fresh content for this node.
ref struct Node.Enumerator
Stack-only enumerator over a node's visible children.
public ref struct Enumerator
{
public readonly Node Current { get; }
public bool MoveNext();
}
readonly Node Enumerator.Current
public readonly Node Current { get; }
The current child. Valid only after MoveNext returns true.
bool Enumerator.MoveNext()
public bool MoveNext();
Advances to the next visible child in presentation order.