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

Function canvasManuallyDefinedArgumentTest

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

Source from the content-addressed store, hash-verified

38});
39
40function canvasManuallyDefinedArgumentTest(mode) {
41 const gpu = new GPU({ mode });
42 const canvas = greenCanvas(mode, 1, 1);
43 const kernel = gpu.createKernel(function(canvas) {
44 const pixel = canvas[this.thread.y][this.thread.x];
45 return pixel[1];
46 }, {
47 output : [canvas.width, canvas.height],
48 argumentTypes: { canvas: 'HTMLCanvas' }
49 });
50 const result = kernel(canvas);
51 assert.equal(result[0][0], 1);
52 gpu.destroy();
53}
54
55(typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined auto', () => {
56 canvasManuallyDefinedArgumentTest();

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…