MCPcopy Create free account
hub / github.com/ChartGPU/ChartGPU / render

Function render

src/renderers/createPieRenderer.ts:381–399  ·  view source on GitHub ↗
(passEncoder)

Source from the content-addressed store, hash-verified

379 };
380
381 const render: PieRenderer['render'] = (passEncoder) => {
382 assertNotDisposed();
383 if (!instanceBuffer || instanceCount === 0) return;
384
385 // Clip to plot area (scissor is in device pixels).
386 if (lastScissor && lastCanvasWidth > 0 && lastCanvasHeight > 0) {
387 passEncoder.setScissorRect(lastScissor.x, lastScissor.y, lastScissor.w, lastScissor.h);
388 }
389
390 passEncoder.setPipeline(pipeline);
391 passEncoder.setBindGroup(0, bindGroup);
392 passEncoder.setVertexBuffer(0, instanceBuffer);
393 passEncoder.draw(6, instanceCount);
394
395 // Reset scissor to full canvas to avoid impacting later renderers.
396 if (lastScissor && lastCanvasWidth > 0 && lastCanvasHeight > 0) {
397 passEncoder.setScissorRect(0, 0, lastCanvasWidth, lastCanvasHeight);
398 }
399 };
400
401 const dispose: PieRenderer['dispose'] = () => {
402 if (disposed) return;

Callers

nothing calls this directly

Calls 1

assertNotDisposedFunction · 0.70

Tested by

no test coverage detected