@antv/g-webgpu 1.7.23 → 1.7.25
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/ContextRegisterPlugin.d.ts.map +1 -1
- package/dist/WebGPUContextService.d.ts +4 -6
- package/dist/WebGPUContextService.d.ts.map +1 -1
- package/dist/index.esm.js +11 -50
- package/dist/index.js +10 -49
- package/dist/index.umd.js +8371 -8672
- package/dist/index.umd.min.js +6 -6
- package/package.json +7 -7
- package/dist/tokens.d.ts +0 -3
- package/dist/tokens.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextRegisterPlugin.d.ts","sourceRoot":"","sources":["../src/ContextRegisterPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"ContextRegisterPlugin.d.ts","sourceRoot":"","sources":["../src/ContextRegisterPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,KAAK,cAAc,MAAM,gCAAgC,CAAC;AAGtE,qBAAa,qBAAsB,SAAQ,sBAAsB;IAEnD,OAAO,CAAC,cAAc;IADlC,IAAI,SAA6B;gBACb,cAAc,EAAE,cAAc,CAAC,MAAM;IAIzD,IAAI,IAAI,IAAI;IAKZ,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/// <reference types="@webgpu/types" />
|
|
2
|
-
import type { CanvasLike, DataURLOptions } from '@antv/g-lite';
|
|
3
|
-
import { CanvasConfig, ContextService } from '@antv/g-lite';
|
|
4
|
-
import type * as DeviceRenderer from '@antv/g-plugin-device-renderer';
|
|
2
|
+
import type { CanvasContext, CanvasLike, DataURLOptions, GlobalRuntime, ContextService } from '@antv/g-lite';
|
|
5
3
|
export declare class WebGPUContextService implements ContextService<GPUCanvasContext> {
|
|
6
|
-
private canvasConfig;
|
|
7
|
-
private deviceRendererPlugin;
|
|
8
4
|
private $container;
|
|
9
5
|
private $canvas;
|
|
10
6
|
private dpr;
|
|
11
|
-
|
|
7
|
+
private canvasConfig;
|
|
8
|
+
private deviceRendererPlugin;
|
|
9
|
+
constructor(context: GlobalRuntime & CanvasContext);
|
|
12
10
|
init(): Promise<void>;
|
|
13
11
|
getDomElement(): CanvasLike;
|
|
14
12
|
getContext(): GPUCanvasContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebGPUContextService.d.ts","sourceRoot":"","sources":["../src/WebGPUContextService.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,
|
|
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;IAM5C,IAAI;IA6BV,aAAa;IAIb,UAAU;IAKV,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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { setDOMSize, isBrowser, AbstractRendererPlugin, AbstractRenderer } from '@antv/g-lite';
|
|
2
2
|
import { Plugin } from '@antv/g-plugin-device-renderer';
|
|
3
3
|
import * as DeviceRenderer from '@antv/g-plugin-device-renderer';
|
|
4
4
|
export { DeviceRenderer };
|
|
@@ -410,43 +410,16 @@ function _setPrototypeOf(o, p) {
|
|
|
410
410
|
return _setPrototypeOf(o, p);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
var DeviceRendererPlugin = Syringe.defineToken('');
|
|
414
|
-
|
|
415
|
-
/******************************************************************************
|
|
416
|
-
Copyright (c) Microsoft Corporation.
|
|
417
|
-
|
|
418
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
419
|
-
purpose with or without fee is hereby granted.
|
|
420
|
-
|
|
421
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
422
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
423
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
424
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
425
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
426
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
427
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
428
|
-
***************************************************************************** */
|
|
429
|
-
|
|
430
|
-
function __decorate(decorators, target, key, desc) {
|
|
431
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
432
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
433
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
434
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
function __param(paramIndex, decorator) {
|
|
438
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
439
|
-
}
|
|
440
|
-
|
|
441
413
|
var WebGPUContextService = /*#__PURE__*/function () {
|
|
442
|
-
function WebGPUContextService(
|
|
443
|
-
this.canvasConfig = void 0;
|
|
444
|
-
this.deviceRendererPlugin = void 0;
|
|
414
|
+
function WebGPUContextService(context) {
|
|
445
415
|
this.$container = void 0;
|
|
446
416
|
this.$canvas = void 0;
|
|
447
417
|
this.dpr = void 0;
|
|
448
|
-
this.canvasConfig =
|
|
449
|
-
this.deviceRendererPlugin =
|
|
418
|
+
this.canvasConfig = void 0;
|
|
419
|
+
this.deviceRendererPlugin = void 0;
|
|
420
|
+
this.canvasConfig = context.config; // @ts-ignore
|
|
421
|
+
|
|
422
|
+
this.deviceRendererPlugin = context.deviceRendererPlugin;
|
|
450
423
|
}
|
|
451
424
|
|
|
452
425
|
var _proto = WebGPUContextService.prototype;
|
|
@@ -581,16 +554,6 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
581
554
|
return WebGPUContextService;
|
|
582
555
|
}();
|
|
583
556
|
|
|
584
|
-
WebGPUContextService = __decorate([singleton({
|
|
585
|
-
token: ContextService
|
|
586
|
-
}), __param(0, inject(CanvasConfig)), __param(1, inject(DeviceRendererPlugin))], WebGPUContextService);
|
|
587
|
-
|
|
588
|
-
var containerModule = Module(function (register) {
|
|
589
|
-
/**
|
|
590
|
-
* implements ContextService
|
|
591
|
-
*/
|
|
592
|
-
register(WebGPUContextService);
|
|
593
|
-
});
|
|
594
557
|
var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
595
558
|
_inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
|
|
596
559
|
|
|
@@ -607,15 +570,13 @@ var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
|
607
570
|
var _proto = ContextRegisterPlugin.prototype;
|
|
608
571
|
|
|
609
572
|
_proto.init = function init() {
|
|
610
|
-
this.
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
this.container.load(containerModule, true);
|
|
573
|
+
this.context.ContextService = WebGPUContextService; // @ts-ignore
|
|
574
|
+
|
|
575
|
+
this.context.deviceRendererPlugin = this.rendererPlugin;
|
|
614
576
|
};
|
|
615
577
|
|
|
616
578
|
_proto.destroy = function destroy() {
|
|
617
|
-
this.
|
|
618
|
-
this.container.remove(DeviceRendererPlugin);
|
|
579
|
+
delete this.context.ContextService;
|
|
619
580
|
};
|
|
620
581
|
|
|
621
582
|
return ContextRegisterPlugin;
|
package/dist/index.js
CHANGED
|
@@ -431,43 +431,16 @@ function _setPrototypeOf(o, p) {
|
|
|
431
431
|
return _setPrototypeOf(o, p);
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
var DeviceRendererPlugin = gLite.Syringe.defineToken('');
|
|
435
|
-
|
|
436
|
-
/******************************************************************************
|
|
437
|
-
Copyright (c) Microsoft Corporation.
|
|
438
|
-
|
|
439
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
440
|
-
purpose with or without fee is hereby granted.
|
|
441
|
-
|
|
442
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
443
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
444
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
445
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
446
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
447
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
448
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
449
|
-
***************************************************************************** */
|
|
450
|
-
|
|
451
|
-
function __decorate(decorators, target, key, desc) {
|
|
452
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
453
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
454
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
455
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
function __param(paramIndex, decorator) {
|
|
459
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
460
|
-
}
|
|
461
|
-
|
|
462
434
|
var WebGPUContextService = /*#__PURE__*/function () {
|
|
463
|
-
function WebGPUContextService(
|
|
464
|
-
this.canvasConfig = void 0;
|
|
465
|
-
this.deviceRendererPlugin = void 0;
|
|
435
|
+
function WebGPUContextService(context) {
|
|
466
436
|
this.$container = void 0;
|
|
467
437
|
this.$canvas = void 0;
|
|
468
438
|
this.dpr = void 0;
|
|
469
|
-
this.canvasConfig =
|
|
470
|
-
this.deviceRendererPlugin =
|
|
439
|
+
this.canvasConfig = void 0;
|
|
440
|
+
this.deviceRendererPlugin = void 0;
|
|
441
|
+
this.canvasConfig = context.config; // @ts-ignore
|
|
442
|
+
|
|
443
|
+
this.deviceRendererPlugin = context.deviceRendererPlugin;
|
|
471
444
|
}
|
|
472
445
|
|
|
473
446
|
var _proto = WebGPUContextService.prototype;
|
|
@@ -602,16 +575,6 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
602
575
|
return WebGPUContextService;
|
|
603
576
|
}();
|
|
604
577
|
|
|
605
|
-
WebGPUContextService = __decorate([gLite.singleton({
|
|
606
|
-
token: gLite.ContextService
|
|
607
|
-
}), __param(0, gLite.inject(gLite.CanvasConfig)), __param(1, gLite.inject(DeviceRendererPlugin))], WebGPUContextService);
|
|
608
|
-
|
|
609
|
-
var containerModule = gLite.Module(function (register) {
|
|
610
|
-
/**
|
|
611
|
-
* implements ContextService
|
|
612
|
-
*/
|
|
613
|
-
register(WebGPUContextService);
|
|
614
|
-
});
|
|
615
578
|
var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
616
579
|
_inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
|
|
617
580
|
|
|
@@ -628,15 +591,13 @@ var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
|
628
591
|
var _proto = ContextRegisterPlugin.prototype;
|
|
629
592
|
|
|
630
593
|
_proto.init = function init() {
|
|
631
|
-
this.
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
this.container.load(containerModule, true);
|
|
594
|
+
this.context.ContextService = WebGPUContextService; // @ts-ignore
|
|
595
|
+
|
|
596
|
+
this.context.deviceRendererPlugin = this.rendererPlugin;
|
|
635
597
|
};
|
|
636
598
|
|
|
637
599
|
_proto.destroy = function destroy() {
|
|
638
|
-
this.
|
|
639
|
-
this.container.remove(DeviceRendererPlugin);
|
|
600
|
+
delete this.context.ContextService;
|
|
640
601
|
};
|
|
641
602
|
|
|
642
603
|
return ContextRegisterPlugin;
|