Vixen
02b45cc4
csharp
public sealed class UiGeometryBuilder

Turns a frame's draw list into the vertices a renderer submits.

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

Remarks

The last step that is still the interface's own. Everything below here is a pipeline, a buffer and a scissor; everything above is elements and styles. Being a pure function of a draw list is what lets the whole of it be tested without a device — the same argument the draw list itself makes about being testable without a window.

⚠ Boxes are one quad each, not a tessellated outline. A rounded rectangle and its border are both a signed distance the shader evaluates per pixel, so a corner is exact at any radius and costs four vertices — where tessellating one costs a vertex count that grows with the radius and is still faceted. That is also why the two share a batch kind: one shader draws both, with the thickness deciding whether the inside is filled.

⚠ Clips are resolved here rather than replayed. A draw list pushes and pops; a renderer sets a scissor. Carrying the resolved rectangle on each draw means the renderer never holds a stack, and cannot be caught out by a batch it skipped having left one behind.

Fields and properties (10)

  • public int CachedPaths

    How many distinct paths the tessellation cache is holding.

  • public IconAtlas? Icons

    The icons this builder has drawn from the atlas, or null before it has drawn any.

  • public int RefusedFields

    How many of the last frame's field paths the atlas could not take.

  • public int FieldPaths

    How many of the last frame's paths were drawn as four vertices from the atlas.

  • public int TessellatedPaths

    How many of the last frame's paths had to be tessellated rather than re-used.

  • public int CacheCapacity

    How many paths the cache keeps before it drops the ones this frame did not use.

  • public int DroppedGlyphs

    How many glyphs were dropped because the atlas could not hold them.

  • public bool AtlasChanged

    Whether the atlas changed while this frame's quads were being emitted.

  • public float Tolerance

    How far a flattened curve may sit from the curve it replaces, in document pixels.

  • public float Fringe

    How far a path's antialiasing fringe reaches past its outline, in document pixels.

Methods (1)

Used by (11)

  • UiHostHelloUi
  • IconAtlasTestsVixen.Ui.Tests
  • NineSliceImageTestsVixen.Ui.Tests
  • PathTessellationCacheTestsVixen.Ui.Tests
  • UiFrameLifetimeTestsVixen.Graphics.Golden.Tests
  • UiGeometryTestsVixen.Ui.Tests
  • UiImageTestsVixen.Graphics.Golden.Tests
  • UiTestVixen.Ui.Testing
  • VideoInUiTestsVixen.Video.Rendering.Tests
  • EditorHostVixen.Editor.Host
  • EditorPaneVixen.Editor.Host