@antv/g-webgpu 1.7.71 → 1.7.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WebGPUContextService.d.ts +1 -1
- package/dist/WebGPUContextService.d.ts.map +1 -1
- package/dist/index.esm.js +34 -45
- package/dist/index.js +34 -45
- package/dist/index.umd.js +478 -1496
- package/dist/index.umd.min.js +1 -1
- package/package.json +6 -6
|
@@ -7,7 +7,7 @@ export declare class WebGPUContextService implements ContextService<GPUCanvasCon
|
|
|
7
7
|
private canvasConfig;
|
|
8
8
|
private deviceRendererPlugin;
|
|
9
9
|
constructor(context: GlobalRuntime & CanvasContext);
|
|
10
|
-
init():
|
|
10
|
+
init(): void;
|
|
11
11
|
getDomElement(): CanvasLike;
|
|
12
12
|
getContext(): GPUCanvasContext;
|
|
13
13
|
getBoundingClientRect(): DOMRect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebGPUContextService.d.ts","sourceRoot":"","sources":["../src/WebGPUContextService.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EAEb,cAAc,EACf,MAAM,cAAc,CAAC;AAKtB,qBAAa,oBAAqB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAC3E,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,oBAAoB,CAAwB;gBAExC,OAAO,EAAE,aAAa,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"WebGPUContextService.d.ts","sourceRoot":"","sources":["../src/WebGPUContextService.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EAEb,cAAc,EACf,MAAM,cAAc,CAAC;AAKtB,qBAAa,oBAAqB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAC3E,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,oBAAoB,CAAwB;gBAExC,OAAO,EAAE,aAAa,GAAG,aAAa;IAMlD,IAAI;IAkCJ,aAAa;IAIb,UAAU;IAOV,qBAAqB;IAMrB,OAAO;IAQP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAmBpC,MAAM;IAIN,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAMzB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC;CAGjD"}
|
package/dist/index.esm.js
CHANGED
|
@@ -370,51 +370,40 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
370
370
|
this.deviceRendererPlugin = context.deviceRendererPlugin;
|
|
371
371
|
}
|
|
372
372
|
var _proto = WebGPUContextService.prototype;
|
|
373
|
-
_proto.init =
|
|
374
|
-
var
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
this.$container.appendChild($canvas);
|
|
394
|
-
if (!this.$container.style.position) {
|
|
395
|
-
this.$container.style.position = 'relative';
|
|
396
|
-
}
|
|
397
|
-
this.$canvas = $canvas;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
this.resize(this.canvasConfig.width, this.canvasConfig.height);
|
|
401
|
-
case 3:
|
|
402
|
-
case "end":
|
|
403
|
-
return _context.stop();
|
|
373
|
+
_proto.init = function init() {
|
|
374
|
+
var _this$canvasConfig = this.canvasConfig,
|
|
375
|
+
container = _this$canvasConfig.container,
|
|
376
|
+
canvas = _this$canvasConfig.canvas;
|
|
377
|
+
if (canvas) {
|
|
378
|
+
this.$canvas = canvas;
|
|
379
|
+
if (container && canvas.parentElement !== container) {
|
|
380
|
+
container.appendChild(canvas);
|
|
381
|
+
}
|
|
382
|
+
this.$container = canvas.parentElement;
|
|
383
|
+
this.canvasConfig.container = this.$container;
|
|
384
|
+
} else if (container) {
|
|
385
|
+
// create container
|
|
386
|
+
this.$container = isString(container) ? document.getElementById(container) : container;
|
|
387
|
+
if (this.$container) {
|
|
388
|
+
// create canvas
|
|
389
|
+
var $canvas = document.createElement('canvas');
|
|
390
|
+
this.$container.appendChild($canvas);
|
|
391
|
+
if (!this.$container.style.position) {
|
|
392
|
+
this.$container.style.position = 'relative';
|
|
404
393
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
function init() {
|
|
408
|
-
return _init.apply(this, arguments);
|
|
394
|
+
this.$canvas = $canvas;
|
|
395
|
+
}
|
|
409
396
|
}
|
|
410
|
-
|
|
411
|
-
}
|
|
397
|
+
this.resize(this.canvasConfig.width, this.canvasConfig.height);
|
|
398
|
+
};
|
|
412
399
|
_proto.getDomElement = function getDomElement() {
|
|
413
400
|
return this.$canvas;
|
|
414
401
|
};
|
|
415
402
|
_proto.getContext = function getContext() {
|
|
416
|
-
|
|
417
|
-
|
|
403
|
+
return (
|
|
404
|
+
// @ts-ignore
|
|
405
|
+
this.deviceRendererPlugin.getDevice().canvasContext
|
|
406
|
+
);
|
|
418
407
|
};
|
|
419
408
|
_proto.getBoundingClientRect = function getBoundingClientRect() {
|
|
420
409
|
if (this.$canvas.getBoundingClientRect) {
|
|
@@ -452,16 +441,16 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
452
441
|
}
|
|
453
442
|
};
|
|
454
443
|
_proto.toDataURL = /*#__PURE__*/function () {
|
|
455
|
-
var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
456
|
-
return _regeneratorRuntime().wrap(function
|
|
457
|
-
while (1) switch (
|
|
444
|
+
var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
445
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
446
|
+
while (1) switch (_context.prev = _context.next) {
|
|
458
447
|
case 0:
|
|
459
|
-
return
|
|
448
|
+
return _context.abrupt("return", '');
|
|
460
449
|
case 1:
|
|
461
450
|
case "end":
|
|
462
|
-
return
|
|
451
|
+
return _context.stop();
|
|
463
452
|
}
|
|
464
|
-
},
|
|
453
|
+
}, _callee);
|
|
465
454
|
}));
|
|
466
455
|
function toDataURL(_x) {
|
|
467
456
|
return _toDataURL.apply(this, arguments);
|
package/dist/index.js
CHANGED
|
@@ -391,51 +391,40 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
391
391
|
this.deviceRendererPlugin = context.deviceRendererPlugin;
|
|
392
392
|
}
|
|
393
393
|
var _proto = WebGPUContextService.prototype;
|
|
394
|
-
_proto.init =
|
|
395
|
-
var
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
this.$container.appendChild($canvas);
|
|
415
|
-
if (!this.$container.style.position) {
|
|
416
|
-
this.$container.style.position = 'relative';
|
|
417
|
-
}
|
|
418
|
-
this.$canvas = $canvas;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
this.resize(this.canvasConfig.width, this.canvasConfig.height);
|
|
422
|
-
case 3:
|
|
423
|
-
case "end":
|
|
424
|
-
return _context.stop();
|
|
394
|
+
_proto.init = function init() {
|
|
395
|
+
var _this$canvasConfig = this.canvasConfig,
|
|
396
|
+
container = _this$canvasConfig.container,
|
|
397
|
+
canvas = _this$canvasConfig.canvas;
|
|
398
|
+
if (canvas) {
|
|
399
|
+
this.$canvas = canvas;
|
|
400
|
+
if (container && canvas.parentElement !== container) {
|
|
401
|
+
container.appendChild(canvas);
|
|
402
|
+
}
|
|
403
|
+
this.$container = canvas.parentElement;
|
|
404
|
+
this.canvasConfig.container = this.$container;
|
|
405
|
+
} else if (container) {
|
|
406
|
+
// create container
|
|
407
|
+
this.$container = util.isString(container) ? document.getElementById(container) : container;
|
|
408
|
+
if (this.$container) {
|
|
409
|
+
// create canvas
|
|
410
|
+
var $canvas = document.createElement('canvas');
|
|
411
|
+
this.$container.appendChild($canvas);
|
|
412
|
+
if (!this.$container.style.position) {
|
|
413
|
+
this.$container.style.position = 'relative';
|
|
425
414
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
function init() {
|
|
429
|
-
return _init.apply(this, arguments);
|
|
415
|
+
this.$canvas = $canvas;
|
|
416
|
+
}
|
|
430
417
|
}
|
|
431
|
-
|
|
432
|
-
}
|
|
418
|
+
this.resize(this.canvasConfig.width, this.canvasConfig.height);
|
|
419
|
+
};
|
|
433
420
|
_proto.getDomElement = function getDomElement() {
|
|
434
421
|
return this.$canvas;
|
|
435
422
|
};
|
|
436
423
|
_proto.getContext = function getContext() {
|
|
437
|
-
|
|
438
|
-
|
|
424
|
+
return (
|
|
425
|
+
// @ts-ignore
|
|
426
|
+
this.deviceRendererPlugin.getDevice().canvasContext
|
|
427
|
+
);
|
|
439
428
|
};
|
|
440
429
|
_proto.getBoundingClientRect = function getBoundingClientRect() {
|
|
441
430
|
if (this.$canvas.getBoundingClientRect) {
|
|
@@ -473,16 +462,16 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
473
462
|
}
|
|
474
463
|
};
|
|
475
464
|
_proto.toDataURL = /*#__PURE__*/function () {
|
|
476
|
-
var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
477
|
-
return _regeneratorRuntime().wrap(function
|
|
478
|
-
while (1) switch (
|
|
465
|
+
var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
466
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
467
|
+
while (1) switch (_context.prev = _context.next) {
|
|
479
468
|
case 0:
|
|
480
|
-
return
|
|
469
|
+
return _context.abrupt("return", '');
|
|
481
470
|
case 1:
|
|
482
471
|
case "end":
|
|
483
|
-
return
|
|
472
|
+
return _context.stop();
|
|
484
473
|
}
|
|
485
|
-
},
|
|
474
|
+
}, _callee);
|
|
486
475
|
}));
|
|
487
476
|
function toDataURL(_x) {
|
|
488
477
|
return _toDataURL.apply(this, arguments);
|