@antv/g-webgpu 1.7.26 → 1.7.28
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.umd.js +77 -41
- package/dist/index.umd.min.js +3 -3
- package/package.json +7 -7
package/dist/index.umd.js
CHANGED
|
@@ -6744,6 +6744,33 @@
|
|
|
6744
6744
|
out[15] = m33;
|
|
6745
6745
|
return out;
|
|
6746
6746
|
}
|
|
6747
|
+
/**
|
|
6748
|
+
* Set a mat4 to the identity matrix
|
|
6749
|
+
*
|
|
6750
|
+
* @param {mat4} out the receiving matrix
|
|
6751
|
+
* @returns {mat4} out
|
|
6752
|
+
*/
|
|
6753
|
+
|
|
6754
|
+
|
|
6755
|
+
function identity(out) {
|
|
6756
|
+
out[0] = 1;
|
|
6757
|
+
out[1] = 0;
|
|
6758
|
+
out[2] = 0;
|
|
6759
|
+
out[3] = 0;
|
|
6760
|
+
out[4] = 0;
|
|
6761
|
+
out[5] = 1;
|
|
6762
|
+
out[6] = 0;
|
|
6763
|
+
out[7] = 0;
|
|
6764
|
+
out[8] = 0;
|
|
6765
|
+
out[9] = 0;
|
|
6766
|
+
out[10] = 1;
|
|
6767
|
+
out[11] = 0;
|
|
6768
|
+
out[12] = 0;
|
|
6769
|
+
out[13] = 0;
|
|
6770
|
+
out[14] = 0;
|
|
6771
|
+
out[15] = 1;
|
|
6772
|
+
return out;
|
|
6773
|
+
}
|
|
6747
6774
|
/**
|
|
6748
6775
|
* Multiplies two mat4s
|
|
6749
6776
|
*
|
|
@@ -8353,6 +8380,7 @@
|
|
|
8353
8380
|
this.context = context;
|
|
8354
8381
|
var renderingService = context.renderingService,
|
|
8355
8382
|
renderingContext = context.renderingContext;
|
|
8383
|
+
var canvas = renderingContext.root.ownerDocument.defaultView;
|
|
8356
8384
|
|
|
8357
8385
|
var handleMounted = function handleMounted(e) {
|
|
8358
8386
|
var object = e.target; // collect lights
|
|
@@ -8432,11 +8460,11 @@
|
|
|
8432
8460
|
while (1) {
|
|
8433
8461
|
switch (_context.prev = _context.next) {
|
|
8434
8462
|
case 0:
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8463
|
+
canvas.addEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
8464
|
+
canvas.addEventListener(gLite.ElementEvent.UNMOUNTED, handleUnmounted);
|
|
8465
|
+
canvas.addEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
|
|
8466
|
+
canvas.addEventListener(gLite.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
|
|
8467
|
+
canvas.addEventListener(gLite.ElementEvent.RENDER_ORDER_CHANGED, handleRenderOrderChanged);
|
|
8440
8468
|
_this.context.config.renderer.getConfig().enableDirtyRectangleRendering = false;
|
|
8441
8469
|
$canvas = _this.context.contextService.getDomElement();
|
|
8442
8470
|
_this$context$config = _this.context.config, width = _this$context$config.width, height = _this$context$config.height;
|
|
@@ -8458,7 +8486,7 @@
|
|
|
8458
8486
|
|
|
8459
8487
|
_this.swapChain.configureSwapChain($canvas.width, $canvas.height);
|
|
8460
8488
|
|
|
8461
|
-
|
|
8489
|
+
canvas.addEventListener(gLite.CanvasEvent.RESIZE, function () {
|
|
8462
8490
|
_this.swapChain.configureSwapChain($canvas.width, $canvas.height);
|
|
8463
8491
|
});
|
|
8464
8492
|
|
|
@@ -8476,11 +8504,11 @@
|
|
|
8476
8504
|
renderingService.hooks.destroy.tap(RenderGraphPlugin.tag, function () {
|
|
8477
8505
|
_this.renderHelper.destroy();
|
|
8478
8506
|
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8507
|
+
canvas.removeEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
8508
|
+
canvas.removeEventListener(gLite.ElementEvent.UNMOUNTED, handleUnmounted);
|
|
8509
|
+
canvas.removeEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
|
|
8510
|
+
canvas.removeEventListener(gLite.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
|
|
8511
|
+
canvas.removeEventListener(gLite.ElementEvent.RENDER_ORDER_CHANGED, handleRenderOrderChanged);
|
|
8484
8512
|
});
|
|
8485
8513
|
/**
|
|
8486
8514
|
* build frame graph at the beginning of each frame
|
|
@@ -8692,6 +8720,7 @@
|
|
|
8692
8720
|
this.context = context;
|
|
8693
8721
|
var renderingService = context.renderingService,
|
|
8694
8722
|
renderingContext = context.renderingContext;
|
|
8723
|
+
var canvas = renderingContext.root.ownerDocument.defaultView;
|
|
8695
8724
|
|
|
8696
8725
|
var handleMounted = function handleMounted(e) {
|
|
8697
8726
|
var object = e.target; // @ts-ignore
|
|
@@ -8712,7 +8741,7 @@
|
|
|
8712
8741
|
while (1) {
|
|
8713
8742
|
switch (_context.prev = _context.next) {
|
|
8714
8743
|
case 0:
|
|
8715
|
-
|
|
8744
|
+
canvas.addEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
8716
8745
|
|
|
8717
8746
|
case 1:
|
|
8718
8747
|
case "end":
|
|
@@ -8722,7 +8751,7 @@
|
|
|
8722
8751
|
}, _callee);
|
|
8723
8752
|
})));
|
|
8724
8753
|
renderingService.hooks.destroy.tap(PickingPlugin.tag, function () {
|
|
8725
|
-
|
|
8754
|
+
canvas.removeEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
8726
8755
|
});
|
|
8727
8756
|
/**
|
|
8728
8757
|
* Sync version is not implemented.
|
|
@@ -11964,7 +11993,7 @@
|
|
|
11964
11993
|
var path;
|
|
11965
11994
|
|
|
11966
11995
|
if (object.nodeName !== gLite.Shape.PATH) {
|
|
11967
|
-
path = gLite.parsePath(gLite.convertToPath(object,
|
|
11996
|
+
path = gLite.parsePath(gLite.convertToPath(object, identity(create())), object);
|
|
11968
11997
|
defX = path.rect.x;
|
|
11969
11998
|
defY = path.rect.y; // support negative width/height of Rect
|
|
11970
11999
|
|
|
@@ -13537,14 +13566,10 @@
|
|
|
13537
13566
|
var eps = 0.01; // only contains M & L commands
|
|
13538
13567
|
|
|
13539
13568
|
if (curve.length === 2 && curve[0][0] === 'M' && curve[1][0] === 'C') {
|
|
13540
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13541
13569
|
var _curve$ = curve[0],
|
|
13542
|
-
_1 = _curve$[0],
|
|
13543
13570
|
p1x = _curve$[1],
|
|
13544
|
-
p1y = _curve$[2];
|
|
13545
|
-
|
|
13571
|
+
p1y = _curve$[2];
|
|
13546
13572
|
var _curve$2 = curve[1],
|
|
13547
|
-
_2 = _curve$2[0],
|
|
13548
13573
|
cpx1 = _curve$2[1],
|
|
13549
13574
|
cpy1 = _curve$2[2],
|
|
13550
13575
|
cpx2 = _curve$2[3],
|
|
@@ -15539,7 +15564,7 @@
|
|
|
15539
15564
|
}
|
|
15540
15565
|
|
|
15541
15566
|
var HTML_PREFIX = 'g-html-';
|
|
15542
|
-
var CANVAS_CAMERA_ID = '
|
|
15567
|
+
var CANVAS_CAMERA_ID = 'g-canvas-camera';
|
|
15543
15568
|
|
|
15544
15569
|
var HTMLRenderingPlugin = /*#__PURE__*/function () {
|
|
15545
15570
|
function HTMLRenderingPlugin() {
|
|
@@ -15558,7 +15583,8 @@
|
|
|
15558
15583
|
|
|
15559
15584
|
var camera = context.camera,
|
|
15560
15585
|
renderingContext = context.renderingContext,
|
|
15561
|
-
renderingService = context.renderingService
|
|
15586
|
+
renderingService = context.renderingService,
|
|
15587
|
+
displayObjectPool = context.displayObjectPool;
|
|
15562
15588
|
this.context = context;
|
|
15563
15589
|
var canvas = renderingContext.root.ownerDocument.defaultView;
|
|
15564
15590
|
|
|
@@ -15570,7 +15596,11 @@
|
|
|
15570
15596
|
var object = e.target;
|
|
15571
15597
|
|
|
15572
15598
|
if (object.nodeName === gLite.Shape.HTML) {
|
|
15573
|
-
|
|
15599
|
+
if (!_this.$camera) {
|
|
15600
|
+
_this.$camera = _this.createCamera(camera);
|
|
15601
|
+
} // create DOM element
|
|
15602
|
+
|
|
15603
|
+
|
|
15574
15604
|
var $el = _this.getOrCreateEl(object);
|
|
15575
15605
|
|
|
15576
15606
|
_this.$camera.appendChild($el); // apply documentElement's style
|
|
@@ -15625,11 +15655,13 @@
|
|
|
15625
15655
|
};
|
|
15626
15656
|
|
|
15627
15657
|
var handleCanvasResize = function handleCanvasResize() {
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15658
|
+
if (_this.$camera) {
|
|
15659
|
+
var _this$context$config = _this.context.config,
|
|
15660
|
+
width = _this$context$config.width,
|
|
15661
|
+
height = _this$context$config.height;
|
|
15662
|
+
_this.$camera.style.width = (width || 0) + "px";
|
|
15663
|
+
_this.$camera.style.height = (height || 0) + "px";
|
|
15664
|
+
}
|
|
15633
15665
|
};
|
|
15634
15666
|
|
|
15635
15667
|
renderingService.hooks.init.tapPromise(HTMLRenderingPlugin.tag, /*#__PURE__*/_asyncToGenerator$3( /*#__PURE__*/_regeneratorRuntime$3().mark(function _callee() {
|
|
@@ -15637,13 +15669,16 @@
|
|
|
15637
15669
|
while (1) {
|
|
15638
15670
|
switch (_context.prev = _context.next) {
|
|
15639
15671
|
case 0:
|
|
15640
|
-
|
|
15641
|
-
|
|
15672
|
+
if (displayObjectPool.getHTMLs().length) {
|
|
15673
|
+
// append camera
|
|
15674
|
+
_this.$camera = _this.createCamera(camera);
|
|
15675
|
+
}
|
|
15676
|
+
|
|
15642
15677
|
canvas.addEventListener(gLite.CanvasEvent.RESIZE, handleCanvasResize);
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15678
|
+
canvas.addEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
15679
|
+
canvas.addEventListener(gLite.ElementEvent.UNMOUNTED, handleUnmounted);
|
|
15680
|
+
canvas.addEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
|
|
15681
|
+
canvas.addEventListener(gLite.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
|
|
15647
15682
|
|
|
15648
15683
|
case 6:
|
|
15649
15684
|
case "end":
|
|
@@ -15664,10 +15699,10 @@
|
|
|
15664
15699
|
}
|
|
15665
15700
|
|
|
15666
15701
|
canvas.removeEventListener(gLite.CanvasEvent.RESIZE, handleCanvasResize);
|
|
15667
|
-
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15702
|
+
canvas.removeEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
15703
|
+
canvas.removeEventListener(gLite.ElementEvent.UNMOUNTED, handleUnmounted);
|
|
15704
|
+
canvas.removeEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
|
|
15705
|
+
canvas.removeEventListener(gLite.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
|
|
15671
15706
|
});
|
|
15672
15707
|
};
|
|
15673
15708
|
|
|
@@ -16462,6 +16497,7 @@
|
|
|
16462
16497
|
var renderingService = context.renderingService,
|
|
16463
16498
|
renderingContext = context.renderingContext,
|
|
16464
16499
|
imagePool = context.imagePool;
|
|
16500
|
+
var canvas = renderingContext.root.ownerDocument.defaultView;
|
|
16465
16501
|
|
|
16466
16502
|
var handleMounted = function handleMounted(e) {
|
|
16467
16503
|
var object = e.target;
|
|
@@ -16504,8 +16540,8 @@
|
|
|
16504
16540
|
while (1) {
|
|
16505
16541
|
switch (_context.prev = _context.next) {
|
|
16506
16542
|
case 0:
|
|
16507
|
-
|
|
16508
|
-
|
|
16543
|
+
canvas.addEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
16544
|
+
canvas.addEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
|
|
16509
16545
|
|
|
16510
16546
|
case 2:
|
|
16511
16547
|
case "end":
|
|
@@ -16515,8 +16551,8 @@
|
|
|
16515
16551
|
}, _callee);
|
|
16516
16552
|
})));
|
|
16517
16553
|
renderingService.hooks.destroy.tap(LoadImagePlugin.tag, function () {
|
|
16518
|
-
|
|
16519
|
-
|
|
16554
|
+
canvas.removeEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
|
|
16555
|
+
canvas.removeEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
|
|
16520
16556
|
});
|
|
16521
16557
|
};
|
|
16522
16558
|
|