Skip to content

Commit

Permalink
Add visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davepagurek committed Dec 17, 2024
1 parent e4e020e commit 80a5c5d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/visual/cases/webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ visualSuite('WebGL', function() {
screenshot();
}
);

for (const mode of ['webgl', '2d']) {
visualSuite(`In ${mode} mode`, function() {
visualTest('It can combine multiple filter passes', function(p5, screenshot) {
p5.createCanvas(50, 50, mode === 'webgl' ? p5.WEBGL : p5.P2D);
if (mode === 'webgl') p5.translate(-p5.width/2, -p5.height/2);
p5.background(255);
p5.fill(0);
p5.noStroke();
p5.circle(15, 15, 20);
p5.circle(30, 30, 20);
p5.filter(p5.BLUR, 5);
p5.filter(p5.THRESHOLD);
screenshot();
});
});
}
});

visualSuite('Lights', function() {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
1 change: 1 addition & 0 deletions test/unit/webgl/p5.RendererGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ suite('p5.RendererGL', function() {

suite('external context', function() {
const cases = [
['no modification', () => {}],
['corner rectMode', () => myp5.rectMode(myp5.CORNER)],
['corners rectMode', () => myp5.rectMode(myp5.CORNERS)],
['center rectMode', () => myp5.rectMode(myp5.CENTER)],
Expand Down

0 comments on commit 80a5c5d

Please sign in to comment.