Skip to content

Commit

Permalink
fix: use antialias option in webgl (#2458)
Browse files Browse the repository at this point in the history
* fix: use antialias option in webgl

* chore: update snapshots
  • Loading branch information
xiaoiver authored May 15, 2024
1 parent 20835cc commit 3694768
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 4 deletions.
Binary file modified __tests__/integration/snapshots/Gallery_fujian.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 modified __tests__/integration/snapshots/Line_arc.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 modified __tests__/integration/snapshots/Line_arc_plane.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 modified __tests__/integration/snapshots/Line_dash.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 modified __tests__/integration/snapshots/Line_flow.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 modified __tests__/integration/snapshots/Mask_single.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 modified __tests__/integration/snapshots/Point_column.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 modified __tests__/integration/snapshots/Polygon_extrude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"pnpm": ">=8"
},
"resolutions": {
"d3-array": "1"
"d3-array": "2"
},
"dependencies": {
"@antv/g-device-api": "^1.6.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@turf/meta": "^6.0.2",
"@turf/polygon-to-line": "^6.5.0",
"@turf/union": "^6.5.0",
"d3-array": "1",
"d3-array": "2",
"d3-color": "^1.4.0",
"d3-interpolate": "1.4.0",
"d3-scale": "2",
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/src/device/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ export default class DeviceRendererService implements IRendererService {
private viewportOrigin: ViewportOrigin;

async init(canvas: HTMLCanvasElement, cfg: IRenderConfig): Promise<void> {
const { enableWebGPU, shaderCompilerPath } = cfg;
const { enableWebGPU, shaderCompilerPath, antialias } = cfg;

// this.$container = $container;
this.canvas = canvas;

// TODO: use antialias from cfg
const deviceContribution = enableWebGPU
? new WebGPUDeviceContribution({
shaderCompilerPath,
})
: new WebGLDeviceContribution({
// Use WebGL2 first and downgrade to WebGL1 if WebGL2 is not supported.
targets: ['webgl2', 'webgl1'],
antialias,
onContextLost(e) {
console.warn('context lost', e);
},
Expand Down

0 comments on commit 3694768

Please sign in to comment.