Vixen
dd8b0a81
csharp
public readonly record struct DrawCommand

One thing to draw, in document space.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

One flat struct rather than a class per primitive, with the fields a given kind does not use left at zero. A draw list is walked once per frame in order and never polymorphically dispatched on; a hierarchy would cost a pointer chase and an allocation per command to model something the consumer answers with a switch anyway.

Comparable by value, which is what makes the frame diff a memcmp rather than a visitor.

Fields and properties (30)

  • public DrawCommandKind Kind

    What it draws.

  • public float X

    Its left edge in document space.

  • public float Y

    Its top edge.

  • public float Width

    Its width.

  • public float Height

    Its height.

  • public Color4 Color

    Its colour, in linear space. Unused by the clip commands.

  • public float Radius

    Its corner radius. Zero for square corners.

  • public float Thickness

    A border's width. Zero for the other kinds.

  • public int Offset

    Where this command's data starts in the side buffer its kind uses.

  • public int Length

    How many entries of the side buffer this command uses.

  • public int Font

    Which font, as an index into Fonts.

  • public ulong Image

    Which texture, as the renderer's own name for one.

  • public Rectangle Source

    Which part of the texture to draw, as UVs from the top-left.

  • public UiImageView View

    Which channels of Image to show and through which curve. Unread on every kind but Image.

  • public NineSlice Slice

    How the destination is cut for a nine-slice, in document pixels.

  • public NineSlice SourceSlice

    How Source is cut to match Slice, in UVs.

  • public bool HollowCentre

    Whether a nine-slice leaves its middle cell undrawn.

  • public float FontSize

    The font size in pixels, which is what scales a glyph's outline.

  • public bool HasStyle

    Whether this box has a BoxStyle in Boxes, and where.

  • public PathFillRule FillRule

    How a filled path decides what is inside it.

  • public LineJoin Join

    How a stroked path turns a corner.

  • public LineCap Cap

    How a stroked path's open ends are finished.

  • public float MiterLimit

    How far a miter may reach, as a multiple of the half width.

  • public float Blur

    How far a composited group's surface is blurred, as a Gaussian standard deviation in document pixels. Zero and unread on every kind but LayerPush.

  • public UiBlendMode Blend

    How a composited group's result is mixed with what is under it. Normal and unread on every kind but LayerPush.

  • public UiColorMatrix? Filter

    The colour transform a composited group's filter applies to its surface, or null where there is none. Unread on every kind but LayerPush.

  • public UiDropShadow? Shadow

    The shadow a composited group's filter: drop-shadow() casts from its own alpha, or null where there is none. Unread on every kind but LayerPush.

  • public UiBackdrop? Backdrop

    What a composited group's backdrop-filter does to the picture behind it, or null where there is none. Unread on every kind but LayerPush.

  • public UiTransform? Transform

    The matrix a composited group's rotate and scale place its surface under, or null where there is none. Unread on every kind but LayerPush.

  • public bool HasMask

    The coverage a composited group's mask-image multiplies its surface by, as a range of Masks. Unread on every kind but LayerPush.

Methods (1)

  • public DrawCommand(DrawCommandKind Kind, float X, float Y, float Width, float Height, Color4 Color, float Radius, float Thickness)

    One thing to draw, in document space.

Used by (71, showing 40)

  • BackdropFilterTestsVixen.Ui.Controls.Tests
  • BatchTestsVixen.Ui.Tests
  • BidiMirroringTestsVixen.Ui.Tests
  • BorderLonghandTestsVixen.Ui.Tests
  • BorderStyleTestsVixen.Ui.Tests
  • ColorPickerFocusRingTestsVixen.Ui.Controls.Advanced.Tests
  • ContainmentTestsVixen.Ui.Tests
  • DrawBatcherVixen.Ui
  • DrawContextVixen.Ui
  • DrawContextBoxTestsVixen.Ui.Tests
  • DrawListVixen.Ui
  • DrawListBuilderVixen.Ui
  • DrawListTestsVixen.Ui.Tests
  • DrawnLayerTextTestsVixen.Ui.Tests
  • EditorShellBudgetTestsVixen.Ui.Controls.Advanced.Tests
  • FillRuleTestsVixen.Ui.Testing.Tests
  • FilterBlurTestsVixen.Ui.Controls.Tests
  • FilterColourTestsVixen.Ui.Controls.Tests
  • FilterDropShadowTestsVixen.Ui.Controls.Tests
  • FontFallbackTestsVixen.Ui.Tests
  • ForcedColorsTestsVixen.Ui.Tests
  • GradientTestsVixen.Ui.Tests
  • GroupOpacityTestsVixen.Ui.Controls.Tests
  • IconAtlasTestsVixen.Ui.Tests
  • ImageNineSliceTestsVixen.Ui.Controls.Tests
  • ImageViewBarTestsVixen.Ui.Controls.Advanced.Tests
  • ImageViewTestsVixen.Ui.Controls.Advanced.Tests
  • InlineFragmentPaintingTestsVixen.Ui.Tests
  • InterfaceInAWorldTestsVixen.Engine.Renderer.Tests
  • MaskGradientTestsVixen.Ui.Controls.Tests
  • MixBlendModeLuminanceTestsVixen.Ui.Controls.Tests
  • NineSliceImageTestsVixen.Ui.Tests
  • ObjectFitTestsVixen.Ui.Controls.Tests
  • OrderTestsVixen.Ui.Tests
  • OverflowTestsVixen.Ui.Tests
  • PathTessellationCacheTestsVixen.Ui.Tests
  • PathTestsVixen.Ui.Tests
  • RasterizerTestsVixen.Ui.Testing.Tests
  • RtlFieldMirroringTestsVixen.Ui.Controls.Tests
  • SelectionRangeTestsVixen.Ui.Controls.Tests