Vixen
02b45cc4
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 (22)

  • 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 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.

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 (25)

  • BatchTestsVixen.Ui.Tests
  • DrawBatcherVixen.Ui
  • DrawContextVixen.Ui
  • DrawListVixen.Ui
  • DrawListBuilderVixen.Ui
  • DrawListTestsVixen.Ui.Tests
  • FontFallbackTestsVixen.Ui.Tests
  • IconAtlasTestsVixen.Ui.Tests
  • NineSliceImageTestsVixen.Ui.Tests
  • PathTessellationCacheTestsVixen.Ui.Tests
  • PathTestsVixen.Ui.Tests
  • RasterizerTestsVixen.Ui.Testing.Tests
  • SurfaceTestsVixen.Ui.Tests
  • SurfaceTestsVixen.Ui.Controls.Tests
  • TessellationVixen.Ui
  • TextTestsVixen.Ui.Tests
  • TextWrapTestsVixen.Ui.Tests
  • UiFrameLifetimeTestsVixen.Graphics.Golden.Tests
  • UiGeometryBuilderVixen.Ui
  • UiGeometryTestsVixen.Ui.Tests
  • UiImageTestsVixen.Graphics.Golden.Tests
  • VideoInUiTestsVixen.Video.Rendering.Tests
  • ViewportTestsVixen.Ui.Controls.Advanced.Tests
  • VisibilityTestsVixen.Ui.Testing.Tests
  • ViewTestsVixen.Editor.NodeGraph.Tests