@antv/g-webgpu 1.7.52 → 1.7.54
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/index.esm.js +31 -35
- package/dist/index.js +31 -35
- package/dist/index.umd.js +640 -729
- package/dist/index.umd.min.js +1 -1
- package/package.json +7 -7
package/dist/index.esm.js
CHANGED
|
@@ -374,35 +374,33 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
374
374
|
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
375
375
|
var _this$canvasConfig, container, canvas, $canvas;
|
|
376
376
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
377
|
-
while (1) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
this.$container.style.position = 'relative';
|
|
397
|
-
}
|
|
398
|
-
this.$canvas = $canvas;
|
|
377
|
+
while (1) switch (_context.prev = _context.next) {
|
|
378
|
+
case 0:
|
|
379
|
+
_this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas;
|
|
380
|
+
if (canvas) {
|
|
381
|
+
this.$canvas = canvas;
|
|
382
|
+
if (container && canvas.parentElement !== container) {
|
|
383
|
+
container.appendChild(canvas);
|
|
384
|
+
}
|
|
385
|
+
this.$container = canvas.parentElement;
|
|
386
|
+
this.canvasConfig.container = this.$container;
|
|
387
|
+
} else if (container) {
|
|
388
|
+
// create container
|
|
389
|
+
this.$container = isString(container) ? document.getElementById(container) : container;
|
|
390
|
+
if (this.$container) {
|
|
391
|
+
// create canvas
|
|
392
|
+
$canvas = document.createElement('canvas');
|
|
393
|
+
this.$container.appendChild($canvas);
|
|
394
|
+
if (!this.$container.style.position) {
|
|
395
|
+
this.$container.style.position = 'relative';
|
|
399
396
|
}
|
|
397
|
+
this.$canvas = $canvas;
|
|
400
398
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
399
|
+
}
|
|
400
|
+
this.resize(this.canvasConfig.width, this.canvasConfig.height);
|
|
401
|
+
case 3:
|
|
402
|
+
case "end":
|
|
403
|
+
return _context.stop();
|
|
406
404
|
}
|
|
407
405
|
}, _callee, this);
|
|
408
406
|
}));
|
|
@@ -456,14 +454,12 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
456
454
|
_proto.toDataURL = /*#__PURE__*/function () {
|
|
457
455
|
var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
|
|
458
456
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
459
|
-
while (1) {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
return _context2.stop();
|
|
466
|
-
}
|
|
457
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
458
|
+
case 0:
|
|
459
|
+
return _context2.abrupt("return", '');
|
|
460
|
+
case 1:
|
|
461
|
+
case "end":
|
|
462
|
+
return _context2.stop();
|
|
467
463
|
}
|
|
468
464
|
}, _callee2);
|
|
469
465
|
}));
|
package/dist/index.js
CHANGED
|
@@ -395,35 +395,33 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
395
395
|
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
396
396
|
var _this$canvasConfig, container, canvas, $canvas;
|
|
397
397
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
398
|
-
while (1) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
this.$container.style.position = 'relative';
|
|
418
|
-
}
|
|
419
|
-
this.$canvas = $canvas;
|
|
398
|
+
while (1) switch (_context.prev = _context.next) {
|
|
399
|
+
case 0:
|
|
400
|
+
_this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas;
|
|
401
|
+
if (canvas) {
|
|
402
|
+
this.$canvas = canvas;
|
|
403
|
+
if (container && canvas.parentElement !== container) {
|
|
404
|
+
container.appendChild(canvas);
|
|
405
|
+
}
|
|
406
|
+
this.$container = canvas.parentElement;
|
|
407
|
+
this.canvasConfig.container = this.$container;
|
|
408
|
+
} else if (container) {
|
|
409
|
+
// create container
|
|
410
|
+
this.$container = util.isString(container) ? document.getElementById(container) : container;
|
|
411
|
+
if (this.$container) {
|
|
412
|
+
// create canvas
|
|
413
|
+
$canvas = document.createElement('canvas');
|
|
414
|
+
this.$container.appendChild($canvas);
|
|
415
|
+
if (!this.$container.style.position) {
|
|
416
|
+
this.$container.style.position = 'relative';
|
|
420
417
|
}
|
|
418
|
+
this.$canvas = $canvas;
|
|
421
419
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
420
|
+
}
|
|
421
|
+
this.resize(this.canvasConfig.width, this.canvasConfig.height);
|
|
422
|
+
case 3:
|
|
423
|
+
case "end":
|
|
424
|
+
return _context.stop();
|
|
427
425
|
}
|
|
428
426
|
}, _callee, this);
|
|
429
427
|
}));
|
|
@@ -477,14 +475,12 @@ var WebGPUContextService = /*#__PURE__*/function () {
|
|
|
477
475
|
_proto.toDataURL = /*#__PURE__*/function () {
|
|
478
476
|
var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
|
|
479
477
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
480
|
-
while (1) {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
return _context2.stop();
|
|
487
|
-
}
|
|
478
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
479
|
+
case 0:
|
|
480
|
+
return _context2.abrupt("return", '');
|
|
481
|
+
case 1:
|
|
482
|
+
case "end":
|
|
483
|
+
return _context2.stop();
|
|
488
484
|
}
|
|
489
485
|
}, _callee2);
|
|
490
486
|
}));
|