MCPcopy Index your code
hub / github.com/gpujs/gpu.js / canvasArgumentTest

Function canvasArgumentTest

test/features/canvas.js:6–18  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

4
5describe('features: canvas argument');
6function canvasArgumentTest(mode) {
7 const gpu = new GPU({ mode });
8 const canvas = greenCanvas(mode, 1, 1);
9 const kernel = gpu.createKernel(function(canvas) {
10 const pixel = canvas[this.thread.y][this.thread.x];
11 return pixel[1];
12 }, {
13 output : [canvas.width, canvas.height]
14 });
15 const result = kernel(canvas);
16 assert.equal(result[0][0], 1);
17 gpu.destroy();
18}
19
20(typeof HTMLCanvasElement !== 'undefined' ? test : skip)('auto', () => {
21 canvasArgumentTest();

Callers 1

canvas.jsFile · 0.85

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
greenCanvasFunction · 0.85
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…