GroupRenderer
Defined in: webgl/renderer.ts:341
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:347
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:606
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:933
Returns
Section titled “Returns”void
render()
Section titled “render()”render(
renderPass):void
Defined in: webgl/renderer.ts:919
Draw the combined fill+stroke pass (painter’s order), then the point pass. A pass emptied by replace (zero indices — e.g. a cleared hover overlay kept alive for reuse) is skipped rather than issuing a zero-count draw.
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:929
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
replace()
Section titled “replace()”replace(
buffers):boolean
Defined in: webgl/renderer.ts:719
Replace the group’s ENTIRE geometry + tables in place, reusing the retained GPU
objects — Models/pipelines always, GrowBuffers/GrowTextures within their
capacities (grow + rebind on overflow, exactly like append). This is the
fast path behind WebGLBackend.updateLayer (#218): the hover overlay re-targets
a DIFFERENT drawable per pointer move at the same count, so unlike
updateColors this rewrites geometry too (equal counts never imply equal
geometry), and unlike append it starts over from drawable 0.
Returns FALSE — the caller must fall back to a full rebuild — when the new buffers need a pass this renderer was built without (fill/stroke or points; Models cannot be created here). The REVERSE (a pass exists but the new buffers are empty for it) keeps the pass alive at zero counts, so a hover-out/hover-in alternation (empty <-> non-empty overlay) never rebuilds; render skips zero-index passes.
Parameters
Section titled “Parameters”buffers
Section titled “buffers”Returns
Section titled “Returns”boolean
setSizeMode()
Section titled “setSizeMode()”setSizeMode(
mode):void
Defined in: webgl/renderer.ts:910
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:885
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:898
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:892
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:806
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
updateFlags()
Section titled “updateFlags()”updateFlags(
flags):void
Defined in: webgl/renderer.ts:835
Flags-only fast path (#208): rewrite ONLY the flags texture(s) — the colour tables are untouched (declutter mutates visibility bits, not colours), so a zoom frame uploads N bytes instead of updateColors’ 9·N. Mirrors updateColors’ structure: the shape pass’s table, plus the point pass’s own when it owns its textures (a borrowing point pass shares the shape pass’s flags texture, already written). Same precondition: the drawable set is unchanged (appends go through append()); a count mismatch throws rather than silently corrupting.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”void