Skip to content

Commit 814ad07

Browse files
committed
Add test for feedback
1 parent ebf64c8 commit 814ad07

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

test/unit/visual/cases/webgpu.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,4 +1423,33 @@ visualSuite("WebGPU", function () {
14231423
}
14241424
);
14251425
});
1426+
1427+
visualSuite('Feedback', function() {
1428+
visualTest(
1429+
'Drawing accumulates across frames when background is set in setup',
1430+
async function(p5, screenshot) {
1431+
await p5.createCanvas(50, 50, p5.WEBGPU);
1432+
1433+
// Set an initial background before the draw loop starts.
1434+
// This should persist into the first draw frame.
1435+
p5.background('red');
1436+
1437+
return new Promise(resolve => {
1438+
let frame = 0;
1439+
p5.draw = function() {
1440+
// Draw circles without clearing, so they accumulate
1441+
p5.noStroke();
1442+
p5.fill('blue');
1443+
p5.circle(-15 + frame * 15, 0, 10);
1444+
frame++;
1445+
if (frame >= 3) {
1446+
p5.noLoop();
1447+
screenshot().then(resolve);
1448+
}
1449+
};
1450+
p5.loop();
1451+
});
1452+
}
1453+
);
1454+
});
14261455
});
390 Bytes
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)