(mode, width, height)
| 58 | } |
| 59 | |
| 60 | function greenCanvas(mode, width, height) { |
| 61 | const gpu = new GPU({ mode }); |
| 62 | const kernel = gpu.createKernel(function() { |
| 63 | this.color(0, 1, 0, 1); |
| 64 | }, { output: [width, height], graphical: true }); |
| 65 | kernel(); |
| 66 | const canvas = kernel.canvas; |
| 67 | gpu.destroy(); |
| 68 | return canvas; |
| 69 | } |
| 70 | |
| 71 | const _exports = { |
| 72 | greenCanvas, |
no test coverage detected
searching dependent graphs…