MCPcopy
hub / github.com/processing/p5.js / testFilterShader

Function testFilterShader

test/unit/webgl/p5.RendererGL.js:306–318  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

304
305 suite('custom shaders', function() {
306 function testFilterShader(target) {
307 const fragSrc = `precision highp float;
308 void main() {
309 gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
310 }`;
311 const s = target.createFilterShader(fragSrc);
312 target.filter(s);
313 target.loadPixels();
314 assert.deepEqual(
315 target.get(target.width/2, target.height/2),
316 [255, 255, 0, 255]
317 );
318 }
319
320 test('work with a 2D main canvas', function() {
321 myp5.createCanvas(10, 10);

Callers 1

p5.RendererGL.jsFile · 0.85

Calls 3

filterMethod · 0.45
loadPixelsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected