public readonly record struct UiLayerA subtree drawn into a surface of its own, and composited back once.
Remarks
⚠ The offscreen surface is the size of the whole viewport, not of , and that is the decision that keeps the two renderers honest. A surface the size of the group would need every vertex inside it translated by the group's origin, on both paths, in the same direction, with the same rounding — and a disagreement there is a subtree drawn a pixel off, which no unit test would be looking at and which the goldens would report as a diff somewhere else entirely. At viewport size there is no translation to get wrong: a layer's contents are drawn at exactly the coordinates they would have had, and the composite samples the texel under each pixel. What it costs is memory, on a frame that has a translucent group at all.
⚠ is the ink, not the element's box. Opacity does not clip — CSS Compositing 1 § 3 isolates a group, it does not bound it — so a child overflowing its half-opaque parent must still be composited. The bounds are therefore computed from the vertices the group actually emitted, which is the only description of "everything it drew" available at this stage, and are what the composite quad covers. Sizing it to the element's rectangle instead would cut off exactly the overflow that overflow: visible promises to keep.
Fields and properties (22)
public int FirstThe index of its first UiDraw.
public int CountHow many draws it covers. Its composite draw is the one after them.
public Rectangle BoundsThe part of the surface it actually inks, in document pixels, already rounded out to whole ones, already widened by Blur where there is one, and already narrowed by the clip that was in force where it opened.
public float AlphaWhat the composite is faded by.
public ulong ImageThe number the composite draw names its surface by.
public float BlurThe standard deviation of the Gaussian its surface is blurred by, in document pixels.
public UiBlendMode BlendHow its composite is mixed with the picture already under it.
public UiColorMatrix? FilterThe colour transform its surface is put through, or null where there is none.
public int MaskFirstWhere this group's mask list starts in Masks.
public int MaskCountHow many entries of Masks this group is masked by.
public UiDropShadow? ShadowThe shadow this group's filter: drop-shadow() casts, or null where there is none.
public ulong ShadowImageThe number the shadow's surface is named by. Meaningless when Shadow is null.
public UiBackdrop? BackdropWhat this group's backdrop-filter does to the picture behind it, or null.
public ulong BackdropImageThe number the backdrop's surface is named by. Meaningless when Backdrop is null.
public Rectangle BackdropBoundsThe rectangle the filtered backdrop is drawn in — the group's border box, clipped. Meaningless when Backdrop is null.
public Rectangle BackdropBoxThe element's border box before the clip, which is what BackdropRadius rounds. Meaningless when Backdrop is null.
public float BackdropRadiusThe uniform corner radius BackdropBox is rounded by, in document pixels. Zero for square corners. Meaningless when Backdrop is null.
public UiTransform? TransformThe affine this group's rotate and scale place its surface under.
public int CompositeWhere this group's own composite draw sits in Draws.
public int BackdropDrawWhere this group's backdrop quad sits. Meaningless when Backdrop is null.
public int ShadowDrawWhere this group's shadow quad sits. Meaningless when Shadow is null.
public const int MaximumKernelThe widest kernel either executor will run, in texels each side of the centre.
Methods (2)
public UiLayer(int First, int Count, Rectangle Bounds, float Alpha)A subtree drawn into a surface of its own, and composited back once.
public static int KernelRadius(float blur, float scale)How many texels each side of the centre a blur of this width reads.
Used by (15)
- BackdropFilterTestsVixen.Ui.Controls.Tests
- FilterBlurTestsVixen.Ui.Controls.Tests
- FilterColourTestsVixen.Ui.Controls.Tests
- FilterDropShadowTestsVixen.Ui.Controls.Tests
- FrameVixen.Ui.Testing
- GroupOpacityTestsVixen.Ui.Controls.Tests
- MaskGradientTestsVixen.Ui.Controls.Tests
- MixBlendModeTestsVixen.Ui.Controls.Tests
- TransformPaintTestsVixen.Ui.Controls.Tests
- UiCompositingTestsVixen.Graphics.Golden.Tests
- UiGeometryVixen.Ui
- UiGeometryBuilderVixen.Ui
- UiRavenAgreementTestsVixen.Graphics.Golden.Tests
- UiRendererVixen.Ui.Renderer
- UiTransformProjectiveTestsVixen.Ui.Tests