-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: support stencil union, intersection and mask in webgl (#185) * fix: support stencil union, intersection and mask #184 * chore: commit changeset * chore(release): bump version (#186) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ab4dffc
commit 160c143
Showing
13 changed files
with
1,431 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import _gl from 'gl'; | ||
import { getWebGLDeviceContributionAndCanvas } from '../utils'; | ||
import { render } from '../../examples/demos/stencil-intersection'; | ||
import '../useSnapshotMatchers'; | ||
|
||
describe('Stencil Intersection Operation', () => { | ||
it('should render correctly.', async () => { | ||
const [webGLDeviceContribution, $canvas] = | ||
getWebGLDeviceContributionAndCanvas(); | ||
|
||
const disposeCallback = await render( | ||
webGLDeviceContribution, | ||
$canvas, | ||
false, | ||
); | ||
|
||
const dir = `${__dirname}/snapshots`; | ||
|
||
expect($canvas.getContext('webgl1')).toMatchWebGLSnapshot( | ||
dir, | ||
'stencil-intersection', | ||
); | ||
|
||
disposeCallback(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import _gl from 'gl'; | ||
import { getWebGLDeviceContributionAndCanvas } from '../utils'; | ||
import { render } from '../../examples/demos/stencil-mask'; | ||
import '../useSnapshotMatchers'; | ||
|
||
describe('Stencil Mask', () => { | ||
it('should render correctly.', async () => { | ||
const [webGLDeviceContribution, $canvas] = | ||
getWebGLDeviceContributionAndCanvas(); | ||
|
||
const disposeCallback = await render( | ||
webGLDeviceContribution, | ||
$canvas, | ||
false, | ||
); | ||
|
||
const dir = `${__dirname}/snapshots`; | ||
|
||
expect($canvas.getContext('webgl1')).toMatchWebGLSnapshot( | ||
dir, | ||
'stencil-mask', | ||
); | ||
|
||
disposeCallback(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import _gl from 'gl'; | ||
import { getWebGLDeviceContributionAndCanvas } from '../utils'; | ||
import { render } from '../../examples/demos/stencil-union'; | ||
import '../useSnapshotMatchers'; | ||
|
||
describe('Stencil Union Operation', () => { | ||
it('should render correctly.', async () => { | ||
const [webGLDeviceContribution, $canvas] = | ||
getWebGLDeviceContributionAndCanvas(); | ||
|
||
const disposeCallback = await render( | ||
webGLDeviceContribution, | ||
$canvas, | ||
false, | ||
); | ||
|
||
const dir = `${__dirname}/snapshots`; | ||
|
||
expect($canvas.getContext('webgl1')).toMatchWebGLSnapshot( | ||
dir, | ||
'stencil-union', | ||
); | ||
|
||
disposeCallback(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.