Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use antialias option in webgl #2458

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
xiaoiver marked this conversation as resolved.
Show resolved Hide resolved
onContextLost(e) {
console.warn('context lost', e);
},
Expand Down
Loading