GroupRenderer
Defined in: webgl/renderer.ts:290
Renders one Scene group on the GPU. Geometry is uploaded once; pan/zoom is a transform-uniform update and recolor/visibility is a palette/flags texture update — neither touches the geometry buffers. Appends are O(new): the geometry buffers grow by capacity-doubling (GrowBuffer) and the color/flags textures grow with partial uploads (or a recreate when their texel dimensions change).
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GroupRenderer(
device,buffers,viewportWidth?,viewportHeight?):GroupRenderer
Defined in: webgl/renderer.ts:296
Parameters
Section titled “Parameters”device
Section titled “device”Device
buffers
Section titled “buffers”viewportWidth?
Section titled “viewportWidth?”number = 0
Viewport width in device pixels (for screen-mode point sizing).
viewportHeight?
Section titled “viewportHeight?”number = 0
Viewport height in device pixels (for screen-mode point sizing).
Returns
Section titled “Returns”GroupRenderer
Methods
Section titled “Methods”append()
Section titled “append()”append(
delta):boolean
Defined in: webgl/renderer.ts:554
Append a tail delta in O(new): interleave the new drawables’ fill+stroke into the merged geometry buffers (capacity-doubling) and grow the color/flags textures (partial upload, or recreate on a dimension change). Same observable result as a full rebuild.
Limitation: a pass that does not yet exist (the group was built with NO fill/stroke geometry at all and the first such geometry arrives now) cannot be created incrementally here — we lack the full buffers. The engine guards this by routing such a case to a full rebuild instead. (Unlike the old split fill/stroke passes, a layer that already has either fill or stroke can grow into the other type without a rebuild, since both share one pass.)
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
destroy()
Section titled “destroy()”destroy():
void
Defined in: webgl/renderer.ts:755
Returns
Section titled “Returns”void
render()
Section titled “render()”render(
renderPass):void
Defined in: webgl/renderer.ts:741
Draw the combined fill+stroke pass (painter’s order), then the point pass.
Parameters
Section titled “Parameters”renderPass
Section titled “renderPass”RenderPass
Returns
Section titled “Returns”void
renderPick()
Section titled “renderPick()”renderPick(
renderPass):void
Defined in: webgl/renderer.ts:751
Draw the fill+stroke geometry with each drawable’s id encoded as an RGB color, for GPU color-picking. Render this into a dedicated offscreen pass, then read the pixel under the cursor and decode it with decodePickColor().
Parameters
Section titled “Parameters”renderPass
Section titled “renderPass”RenderPass
Returns
Section titled “Returns”void
setSizeMode()
Section titled “setSizeMode()”setSizeMode(
mode):void
Defined in: webgl/renderer.ts:734
Switch the size mode for the next render. “screen” renders fill/stroke (via the anchor + offset model) and points at a constant pixel size; “world” scales with zoom. Default “world”.
Parameters
Section titled “Parameters”"world" | "screen"
Returns
Section titled “Returns”void
setStencil()
Section titled “setStencil()”setStencil(
mode):void
Defined in: webgl/renderer.ts:709
Switch stencil state for clipping. “write” = clip source (mask), “test” = clipped layer, “off” = normal.
Parameters
Section titled “Parameters”"off" | "write" | "test"
Returns
Section titled “Returns”void
setTransform()
Section titled “setTransform()”setTransform(
m):void
Defined in: webgl/renderer.ts:722
Set the view transform (column-major mat3) for pan/zoom.
Parameters
Section titled “Parameters”Float32Array
Returns
Section titled “Returns”void
setViewport()
Section titled “setViewport()”setViewport(
width,height):void
Defined in: webgl/renderer.ts:716
Update the viewport size (px) used for screen-mode point/glyph sizing on resize.
Parameters
Section titled “Parameters”number
height
Section titled “height”number
Returns
Section titled “Returns”void
updateColors()
Section titled “updateColors()”updateColors(
tables):void
Defined in: webgl/renderer.ts:660
Re-upload the color and flag tables from the style tables. Touches only the palette/flags textures — geometry buffers are untouched, so this is the cheap recolor / show-hide hot path.
Precondition: the drawable set is unchanged (same count) — this is recolor / show-hide, not a geometry change. Adding drawables goes through append(). A count mismatch throws rather than silently corrupting.
Parameters
Section titled “Parameters”tables
Section titled “tables”Returns
Section titled “Returns”void