Skip to content

Commit

Permalink
Release (#187)
Browse files Browse the repository at this point in the history
* 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
3 people authored May 16, 2024
1 parent ab4dffc commit 160c143
Show file tree
Hide file tree
Showing 13 changed files with 1,431 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-device-api

## 1.6.10

### Patch Changes

- 1c7791e: Support stencil union, intersection and mask.

## 1.6.9

### Patch Changes
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/stencil-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/stencil-union.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions __tests__/integration/stencil-intersection.spec.ts
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();
});
});
26 changes: 26 additions & 0 deletions __tests__/integration/stencil-mask.spec.ts
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();
});
});
26 changes: 26 additions & 0 deletions __tests__/integration/stencil-union.spec.ts
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();
});
});
3 changes: 3 additions & 0 deletions examples/demos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export { render as CanvasGradient } from './canvas-gradient';
export { render as RotatingCube } from './rotating-cube';
export { render as NestedRenderPass } from './nested-render-pass';
export { render as Stencil } from './stencil';
export { render as StencilMask } from './stencil-mask';
export { render as StencilUnion } from './stencil-union';
export { render as StencilIntersection } from './stencil-intersection';
export { render as Scissor } from './scissor';
export { render as TwoCubes } from './two-cubes';
export { render as TexturedCube } from './textured-cube';
Expand Down
Loading

0 comments on commit 160c143

Please sign in to comment.