(passEncoder)
| 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; |
nothing calls this directly
no test coverage detected