Skip to content

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

new GroupRenderer(device, buffers, viewportWidth?, viewportHeight?): GroupRenderer

Defined in: webgl/renderer.ts:347

Device

GroupBuffers

number = 0

Viewport width in device pixels (for screen-mode point sizing).

number = 0

Viewport height in device pixels (for screen-mode point sizing).

GroupRenderer

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

GroupBufferDelta

boolean


destroy(): void

Defined in: webgl/renderer.ts:933

void


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.

RenderPass

void


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

RenderPass

void


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.

GroupBuffers

boolean


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

"world" | "screen"

void


setStencil(mode): void

Defined in: webgl/renderer.ts:885

Switch stencil state for clipping. “write” = clip source (mask), “test” = clipped layer, “off” = normal.

"off" | "write" | "test"

void


setTransform(m): void

Defined in: webgl/renderer.ts:898

Set the view transform (column-major mat3) for pan/zoom.

Float32Array

void


setViewport(width, height): void

Defined in: webgl/renderer.ts:892

Update the viewport size (px) used for screen-mode point/glyph sizing on resize.

number

number

void


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.

StyleTables

void


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.

Uint8Array

void