@antv/g-webgpu 1.6.0-alpha.0 → 1.6.0

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 CHANGED
@@ -1534,169 +1534,6 @@
1534
1534
  }
1535
1535
  });
1536
1536
 
1537
- var ImagePool = /*#__PURE__*/function () {
1538
- function ImagePool() {
1539
- this.imageCache = {};
1540
- this.gradientCache = {};
1541
- this.patternCache = {};
1542
- this.canvasConfig = void 0;
1543
- }
1544
-
1545
- var _proto = ImagePool.prototype;
1546
-
1547
- _proto.getImageSync = function getImageSync(src, callback) {
1548
- if (!this.imageCache[src]) {
1549
- this.getOrCreateImage(src).then(function () {
1550
- if (callback) {
1551
- callback();
1552
- }
1553
- });
1554
- }
1555
-
1556
- return this.imageCache[src];
1557
- };
1558
-
1559
- _proto.getOrCreateImage = function getOrCreateImage(src) {
1560
- var _this = this;
1561
-
1562
- if (this.imageCache[src]) {
1563
- return Promise.resolve(this.imageCache[src]);
1564
- } // @see https://github.com/antvis/g/issues/938
1565
-
1566
-
1567
- var createImage = this.canvasConfig.createImage;
1568
- return new Promise(function (resolve, reject) {
1569
- var image;
1570
-
1571
- if (createImage) {
1572
- image = createImage(src);
1573
- } else if (g.isBrowser) {
1574
- image = new window.Image();
1575
- }
1576
-
1577
- if (image) {
1578
- image.onload = function () {
1579
- resolve(image);
1580
- };
1581
-
1582
- image.onerror = function (ev) {
1583
- reject(ev);
1584
- };
1585
-
1586
- image.crossOrigin = 'Anonymous';
1587
- image.src = src;
1588
- _this.imageCache[src] = image;
1589
- }
1590
- });
1591
- };
1592
-
1593
- _proto.getOrCreatePatternSync = function getOrCreatePatternSync(pattern, context, callback) {
1594
- var patternKey = this.generatePatternKey(pattern);
1595
-
1596
- if (patternKey && this.patternCache[patternKey]) {
1597
- return this.patternCache[patternKey];
1598
- }
1599
-
1600
- var image = pattern.image,
1601
- repetition = pattern.repetition;
1602
- var src; // Image URL
1603
-
1604
- if (g.isString(image)) {
1605
- src = this.getImageSync(image, callback);
1606
- } else {
1607
- src = image;
1608
- } // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createPattern
1609
-
1610
-
1611
- var canvasPattern = src && context.createPattern(src, repetition);
1612
-
1613
- if (patternKey && canvasPattern) {
1614
- this.patternCache[patternKey] = canvasPattern;
1615
- }
1616
-
1617
- return canvasPattern;
1618
- };
1619
-
1620
- _proto.getOrCreateGradient = function getOrCreateGradient(params, context) {
1621
- var key = this.generateGradientKey(params); // @ts-ignore
1622
-
1623
- var type = params.type,
1624
- steps = params.steps,
1625
- width = params.width,
1626
- height = params.height,
1627
- angle = params.angle,
1628
- cx = params.cx,
1629
- cy = params.cy;
1630
-
1631
- if (this.gradientCache[key]) {
1632
- return this.gradientCache[key];
1633
- }
1634
-
1635
- var gradient = null;
1636
-
1637
- if (type === g.GradientType.LinearGradient) {
1638
- var _computeLinearGradien = g.computeLinearGradient(width, height, angle),
1639
- x1 = _computeLinearGradien.x1,
1640
- y1 = _computeLinearGradien.y1,
1641
- x2 = _computeLinearGradien.x2,
1642
- y2 = _computeLinearGradien.y2; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createLinearGradient
1643
-
1644
-
1645
- gradient = context.createLinearGradient(x1, y1, x2, y2);
1646
- } else if (type === g.GradientType.RadialGradient) {
1647
- var _computeRadialGradien = g.computeRadialGradient(width, height, cx, cy),
1648
- x = _computeRadialGradien.x,
1649
- y = _computeRadialGradien.y,
1650
- r = _computeRadialGradien.r; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createRadialGradient
1651
-
1652
-
1653
- gradient = context.createRadialGradient(x, y, 0, x, y, r);
1654
- }
1655
-
1656
- if (gradient) {
1657
- steps.forEach(function (_ref) {
1658
- var _gradient;
1659
-
1660
- var offset = _ref[0],
1661
- color = _ref[1];
1662
- (_gradient = gradient) === null || _gradient === void 0 ? void 0 : _gradient.addColorStop(offset, color);
1663
- });
1664
- this.gradientCache[key] = gradient;
1665
- }
1666
-
1667
- return this.gradientCache[key];
1668
- };
1669
-
1670
- _proto.generateGradientKey = function generateGradientKey(params) {
1671
- // @ts-ignore
1672
- var type = params.type,
1673
- width = params.width,
1674
- height = params.height,
1675
- steps = params.steps,
1676
- angle = params.angle,
1677
- cx = params.cx,
1678
- cy = params.cy;
1679
- return "gradient-" + type + "-" + (angle || 0) + "-" + (cx || 0) + "-" + (cy || 0) + "-" + width + "-" + height + "-" + steps.map(function (step) {
1680
- return step.join('');
1681
- }).join('-');
1682
- };
1683
-
1684
- _proto.generatePatternKey = function generatePatternKey(pattern) {
1685
- var image = pattern.image,
1686
- repetition = pattern.repetition; // only generate cache for Image
1687
-
1688
- if (g.isString(image)) {
1689
- return "pattern-" + image + "-" + repetition;
1690
- }
1691
- };
1692
-
1693
- return ImagePool;
1694
- }();
1695
-
1696
- __decorate([g.inject(g.CanvasConfig), __metadata("design:type", Object)], ImagePool.prototype, "canvasConfig", void 0);
1697
-
1698
- ImagePool = __decorate([g.singleton()], ImagePool);
1699
-
1700
1537
  function _regeneratorRuntime$1() {
1701
1538
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1702
1539
  _regeneratorRuntime$1 = function _regeneratorRuntime() {
@@ -2074,14 +1911,192 @@
2074
1911
  asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
2075
1912
  }
2076
1913
 
2077
- function _throw(err) {
2078
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
2079
- }
1914
+ function _throw(err) {
1915
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
1916
+ }
1917
+
1918
+ _next(undefined);
1919
+ });
1920
+ };
1921
+ }
1922
+
1923
+ function _inheritsLoose$1(subClass, superClass) {
1924
+ subClass.prototype = Object.create(superClass.prototype);
1925
+ subClass.prototype.constructor = subClass;
1926
+
1927
+ _setPrototypeOf$1(subClass, superClass);
1928
+ }
1929
+
1930
+ function _setPrototypeOf$1(o, p) {
1931
+ _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
1932
+ o.__proto__ = p;
1933
+ return o;
1934
+ };
1935
+ return _setPrototypeOf$1(o, p);
1936
+ }
1937
+
1938
+ var ImagePool = /*#__PURE__*/function () {
1939
+ function ImagePool() {
1940
+ this.imageCache = {};
1941
+ this.gradientCache = {};
1942
+ this.patternCache = {};
1943
+ this.canvasConfig = void 0;
1944
+ }
1945
+
1946
+ var _proto = ImagePool.prototype;
1947
+
1948
+ _proto.getImageSync = function getImageSync(src, callback) {
1949
+ if (!this.imageCache[src]) {
1950
+ this.getOrCreateImage(src).then(function () {
1951
+ if (callback) {
1952
+ callback();
1953
+ }
1954
+ });
1955
+ }
1956
+
1957
+ return this.imageCache[src];
1958
+ };
1959
+
1960
+ _proto.getOrCreateImage = function getOrCreateImage(src) {
1961
+ var _this = this;
1962
+
1963
+ if (this.imageCache[src]) {
1964
+ return Promise.resolve(this.imageCache[src]);
1965
+ } // @see https://github.com/antvis/g/issues/938
1966
+
1967
+
1968
+ var createImage = this.canvasConfig.createImage;
1969
+ return new Promise(function (resolve, reject) {
1970
+ var image;
1971
+
1972
+ if (createImage) {
1973
+ image = createImage(src);
1974
+ } else if (g.isBrowser) {
1975
+ image = new window.Image();
1976
+ }
1977
+
1978
+ if (image) {
1979
+ image.onload = function () {
1980
+ resolve(image);
1981
+ };
1982
+
1983
+ image.onerror = function (ev) {
1984
+ reject(ev);
1985
+ };
1986
+
1987
+ image.crossOrigin = 'Anonymous';
1988
+ image.src = src;
1989
+ _this.imageCache[src] = image;
1990
+ }
1991
+ });
1992
+ };
1993
+
1994
+ _proto.getOrCreatePatternSync = function getOrCreatePatternSync(pattern, context, callback) {
1995
+ var patternKey = this.generatePatternKey(pattern);
1996
+
1997
+ if (patternKey && this.patternCache[patternKey]) {
1998
+ return this.patternCache[patternKey];
1999
+ }
2000
+
2001
+ var image = pattern.image,
2002
+ repetition = pattern.repetition;
2003
+ var src; // Image URL
2004
+
2005
+ if (g.isString(image)) {
2006
+ src = this.getImageSync(image, callback);
2007
+ } else {
2008
+ src = image;
2009
+ } // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createPattern
2010
+
2011
+
2012
+ var canvasPattern = src && context.createPattern(src, repetition);
2013
+
2014
+ if (patternKey && canvasPattern) {
2015
+ this.patternCache[patternKey] = canvasPattern;
2016
+ }
2017
+
2018
+ return canvasPattern;
2019
+ };
2020
+
2021
+ _proto.getOrCreateGradient = function getOrCreateGradient(params, context) {
2022
+ var key = this.generateGradientKey(params); // @ts-ignore
2023
+
2024
+ var type = params.type,
2025
+ steps = params.steps,
2026
+ width = params.width,
2027
+ height = params.height,
2028
+ angle = params.angle,
2029
+ cx = params.cx,
2030
+ cy = params.cy;
2031
+
2032
+ if (this.gradientCache[key]) {
2033
+ return this.gradientCache[key];
2034
+ }
2035
+
2036
+ var gradient = null;
2037
+
2038
+ if (type === g.GradientType.LinearGradient) {
2039
+ var _computeLinearGradien = g.computeLinearGradient(width, height, angle),
2040
+ x1 = _computeLinearGradien.x1,
2041
+ y1 = _computeLinearGradien.y1,
2042
+ x2 = _computeLinearGradien.x2,
2043
+ y2 = _computeLinearGradien.y2; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createLinearGradient
2044
+
2045
+
2046
+ gradient = context.createLinearGradient(x1, y1, x2, y2);
2047
+ } else if (type === g.GradientType.RadialGradient) {
2048
+ var _computeRadialGradien = g.computeRadialGradient(width, height, cx, cy),
2049
+ x = _computeRadialGradien.x,
2050
+ y = _computeRadialGradien.y,
2051
+ r = _computeRadialGradien.r; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createRadialGradient
2052
+
2053
+
2054
+ gradient = context.createRadialGradient(x, y, 0, x, y, r);
2055
+ }
2056
+
2057
+ if (gradient) {
2058
+ steps.forEach(function (_ref) {
2059
+ var _gradient;
2060
+
2061
+ var offset = _ref[0],
2062
+ color = _ref[1];
2063
+ (_gradient = gradient) === null || _gradient === void 0 ? void 0 : _gradient.addColorStop(offset, color);
2064
+ });
2065
+ this.gradientCache[key] = gradient;
2066
+ }
2067
+
2068
+ return this.gradientCache[key];
2069
+ };
2070
+
2071
+ _proto.generateGradientKey = function generateGradientKey(params) {
2072
+ // @ts-ignore
2073
+ var type = params.type,
2074
+ width = params.width,
2075
+ height = params.height,
2076
+ steps = params.steps,
2077
+ angle = params.angle,
2078
+ cx = params.cx,
2079
+ cy = params.cy;
2080
+ return "gradient-" + type + "-" + (angle || 0) + "-" + (cx || 0) + "-" + (cy || 0) + "-" + width + "-" + height + "-" + steps.map(function (step) {
2081
+ return step.join('');
2082
+ }).join('-');
2083
+ };
2084
+
2085
+ _proto.generatePatternKey = function generatePatternKey(pattern) {
2086
+ var image = pattern.image,
2087
+ repetition = pattern.repetition; // only generate cache for Image
2080
2088
 
2081
- _next(undefined);
2082
- });
2089
+ if (g.isString(image)) {
2090
+ return "pattern-" + image + "-" + repetition;
2091
+ }
2083
2092
  };
2084
- }
2093
+
2094
+ return ImagePool;
2095
+ }();
2096
+
2097
+ __decorate([g.inject(g.CanvasConfig), __metadata("design:type", Object)], ImagePool.prototype, "canvasConfig", void 0);
2098
+
2099
+ ImagePool = __decorate([g.singleton()], ImagePool);
2085
2100
 
2086
2101
  var _class;
2087
2102
 
@@ -2171,23 +2186,33 @@
2171
2186
  register(LoadImagePlugin);
2172
2187
  });
2173
2188
 
2174
- var Plugin = /*#__PURE__*/function () {
2189
+ var Plugin = /*#__PURE__*/function (_AbstractRendererPlug) {
2190
+ _inheritsLoose$1(Plugin, _AbstractRendererPlug);
2191
+
2175
2192
  function Plugin() {
2176
- this.name = 'image-loader';
2193
+ var _this;
2194
+
2195
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2196
+ args[_key] = arguments[_key];
2197
+ }
2198
+
2199
+ _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
2200
+ _this.name = 'image-loader';
2201
+ return _this;
2177
2202
  }
2178
2203
 
2179
2204
  var _proto = Plugin.prototype;
2180
2205
 
2181
- _proto.init = function init(container) {
2182
- container.load(containerModule, true);
2206
+ _proto.init = function init() {
2207
+ this.container.load(containerModule, true);
2183
2208
  };
2184
2209
 
2185
- _proto.destroy = function destroy(container) {
2186
- container.unload(containerModule);
2210
+ _proto.destroy = function destroy() {
2211
+ this.container.unload(containerModule);
2187
2212
  };
2188
2213
 
2189
2214
  return Plugin;
2190
- }();
2215
+ }(g.AbstractRendererPlugin);
2191
2216
 
2192
2217
  var earcut_1 = earcut;
2193
2218
  var _default = earcut;
@@ -3016,80 +3041,6 @@
3016
3041
  }
3017
3042
  }
3018
3043
 
3019
- var Renderable3D = function Renderable3D() {
3020
- this.pickingId = void 0;
3021
- this.encodedPickingColor = void 0;
3022
- this.meshes = [];
3023
- };
3024
-
3025
- Renderable3D.tag = 'c-renderable-3d';
3026
-
3027
- var LightPool = /*#__PURE__*/function () {
3028
- function LightPool() {
3029
- this.lights = [];
3030
- this.fog = void 0;
3031
- }
3032
-
3033
- var _proto = LightPool.prototype;
3034
-
3035
- _proto.addLight = function addLight(light) {
3036
- this.lights.push(light);
3037
- this.sortLights();
3038
- };
3039
-
3040
- _proto.removeLight = function removeLight(light) {
3041
- var i = this.lights.indexOf(light);
3042
- this.lights.splice(i, 1);
3043
- this.sortLights();
3044
- };
3045
-
3046
- _proto.addFog = function addFog(fog) {
3047
- this.fog = fog;
3048
- };
3049
-
3050
- _proto.removeFog = function removeFog(fog) {
3051
- this.fog = null;
3052
- };
3053
-
3054
- _proto.getFog = function getFog() {
3055
- return this.fog;
3056
- };
3057
-
3058
- _proto.getAllLights = function getAllLights() {
3059
- return this.lights;
3060
- }
3061
- /**
3062
- * USE_LIGHT
3063
- * NUM_AMBIENT_LIGHTS
3064
- * NUM_DIR_LIGHTS
3065
- */
3066
- ;
3067
-
3068
- _proto.getDefines = function getDefines() {
3069
- var defines = {
3070
- USE_LIGHT: !!this.lights.length
3071
- };
3072
- this.lights.forEach(function (light) {
3073
- if (!defines[light.define]) {
3074
- defines[light.define] = 0;
3075
- }
3076
-
3077
- defines[light.define]++;
3078
- });
3079
- return defines;
3080
- };
3081
-
3082
- _proto.sortLights = function sortLights() {
3083
- this.lights.sort(function (a, b) {
3084
- return a.order - b.order;
3085
- });
3086
- };
3087
-
3088
- return LightPool;
3089
- }();
3090
-
3091
- LightPool = __decorate([g.singleton()], LightPool);
3092
-
3093
3044
  function _regeneratorRuntime$2() {
3094
3045
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3095
3046
  _regeneratorRuntime$2 = function _regeneratorRuntime() {
@@ -3512,19 +3463,19 @@
3512
3463
  return _extends.apply(this, arguments);
3513
3464
  }
3514
3465
 
3515
- function _inheritsLoose$1(subClass, superClass) {
3466
+ function _inheritsLoose$2(subClass, superClass) {
3516
3467
  subClass.prototype = Object.create(superClass.prototype);
3517
3468
  subClass.prototype.constructor = subClass;
3518
3469
 
3519
- _setPrototypeOf$1(subClass, superClass);
3470
+ _setPrototypeOf$2(subClass, superClass);
3520
3471
  }
3521
3472
 
3522
- function _setPrototypeOf$1(o, p) {
3523
- _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
3473
+ function _setPrototypeOf$2(o, p) {
3474
+ _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
3524
3475
  o.__proto__ = p;
3525
3476
  return o;
3526
3477
  };
3527
- return _setPrototypeOf$1(o, p);
3478
+ return _setPrototypeOf$2(o, p);
3528
3479
  }
3529
3480
 
3530
3481
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -3590,10 +3541,83 @@
3590
3541
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3591
3542
  }
3592
3543
 
3544
+ var Renderable3D = function Renderable3D() {
3545
+ this.pickingId = void 0;
3546
+ this.encodedPickingColor = void 0;
3547
+ this.meshes = [];
3548
+ };
3549
+
3550
+ Renderable3D.tag = 'c-renderable-3d';
3551
+
3552
+ var LightPool = /*#__PURE__*/function () {
3553
+ function LightPool() {
3554
+ this.lights = [];
3555
+ this.fog = void 0;
3556
+ }
3557
+
3558
+ var _proto = LightPool.prototype;
3559
+
3560
+ _proto.addLight = function addLight(light) {
3561
+ this.lights.push(light);
3562
+ this.sortLights();
3563
+ };
3564
+
3565
+ _proto.removeLight = function removeLight(light) {
3566
+ var i = this.lights.indexOf(light);
3567
+ this.lights.splice(i, 1);
3568
+ this.sortLights();
3569
+ };
3570
+
3571
+ _proto.addFog = function addFog(fog) {
3572
+ this.fog = fog;
3573
+ };
3574
+
3575
+ _proto.removeFog = function removeFog(fog) {
3576
+ this.fog = null;
3577
+ };
3578
+
3579
+ _proto.getFog = function getFog() {
3580
+ return this.fog;
3581
+ };
3582
+
3583
+ _proto.getAllLights = function getAllLights() {
3584
+ return this.lights;
3585
+ }
3586
+ /**
3587
+ * USE_LIGHT
3588
+ * NUM_AMBIENT_LIGHTS
3589
+ * NUM_DIR_LIGHTS
3590
+ */
3591
+ ;
3592
+
3593
+ _proto.getDefines = function getDefines() {
3594
+ var defines = {
3595
+ USE_LIGHT: !!this.lights.length
3596
+ };
3597
+ this.lights.forEach(function (light) {
3598
+ if (!defines[light.define]) {
3599
+ defines[light.define] = 0;
3600
+ }
3601
+
3602
+ defines[light.define]++;
3603
+ });
3604
+ return defines;
3605
+ };
3606
+
3607
+ _proto.sortLights = function sortLights() {
3608
+ this.lights.sort(function (a, b) {
3609
+ return a.order - b.order;
3610
+ });
3611
+ };
3612
+
3613
+ return LightPool;
3614
+ }();
3615
+
3616
+ LightPool = __decorate([g.singleton()], LightPool);
3593
3617
  var _excluded = ["style"];
3594
3618
 
3595
3619
  var Mesh = /*#__PURE__*/function (_DisplayObject) {
3596
- _inheritsLoose$1(Mesh, _DisplayObject);
3620
+ _inheritsLoose$2(Mesh, _DisplayObject);
3597
3621
 
3598
3622
  function Mesh(_ref) {
3599
3623
  var _this;
@@ -6017,7 +6041,7 @@
6017
6041
 
6018
6042
 
6019
6043
  var BufferGeometry = /*#__PURE__*/function (_EventEmitter) {
6020
- _inheritsLoose$1(BufferGeometry, _EventEmitter);
6044
+ _inheritsLoose$2(BufferGeometry, _EventEmitter);
6021
6045
  /**
6022
6046
  * 绘制模式
6023
6047
  */
@@ -6517,7 +6541,7 @@
6517
6541
 
6518
6542
 
6519
6543
  var Material = /*#__PURE__*/function (_EventEmitter) {
6520
- _inheritsLoose$1(Material, _EventEmitter);
6544
+ _inheritsLoose$2(Material, _EventEmitter);
6521
6545
 
6522
6546
  function Material(device, props) {
6523
6547
  var _this;
@@ -6870,7 +6894,7 @@
6870
6894
  }(eventemitter3.EventEmitter);
6871
6895
 
6872
6896
  var ShaderMaterial = /*#__PURE__*/function (_Material) {
6873
- _inheritsLoose$1(ShaderMaterial, _Material);
6897
+ _inheritsLoose$2(ShaderMaterial, _Material);
6874
6898
 
6875
6899
  function ShaderMaterial(device, props) {
6876
6900
  var _this;
@@ -10875,7 +10899,7 @@
10875
10899
  */
10876
10900
 
10877
10901
  var SDFMesh = /*#__PURE__*/function (_Instanced) {
10878
- _inheritsLoose$1(SDFMesh, _Instanced);
10902
+ _inheritsLoose$2(SDFMesh, _Instanced);
10879
10903
 
10880
10904
  function SDFMesh() {
10881
10905
  return _Instanced.apply(this, arguments) || this;
@@ -11069,7 +11093,7 @@
11069
11093
  };
11070
11094
 
11071
11095
  var InstancedLineMesh = /*#__PURE__*/function (_Instanced) {
11072
- _inheritsLoose$1(InstancedLineMesh, _Instanced);
11096
+ _inheritsLoose$2(InstancedLineMesh, _Instanced);
11073
11097
 
11074
11098
  function InstancedLineMesh() {
11075
11099
  return _Instanced.apply(this, arguments) || this;
@@ -11700,7 +11724,7 @@
11700
11724
  })(Uniform || (Uniform = {}));
11701
11725
 
11702
11726
  var LineMesh = /*#__PURE__*/function (_Instanced) {
11703
- _inheritsLoose$1(LineMesh, _Instanced);
11727
+ _inheritsLoose$2(LineMesh, _Instanced);
11704
11728
 
11705
11729
  function LineMesh() {
11706
11730
  return _Instanced.apply(this, arguments) || this;
@@ -12241,7 +12265,7 @@
12241
12265
  var meshVert = "#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_ObjectParams {\n mat4 u_ModelMatrix;\n vec4 u_FillColor;\n vec3 u_PickingColor;\n float u_Opacity;\n float u_FillOpacity;\n float u_Visible;\n float u_ZIndex;\n};\n\nlayout(location = POSITION) in vec2 a_Position;\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nvoid main() {\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n gl_Position = u_ProjectionMatrix * u_ViewMatrix * u_ModelMatrix * vec4(a_Position, u_ZIndex, 1.0);\n}"; // eslint-disable-line
12242
12266
 
12243
12267
  var FillMesh = /*#__PURE__*/function (_Instanced) {
12244
- _inheritsLoose$1(FillMesh, _Instanced);
12268
+ _inheritsLoose$2(FillMesh, _Instanced);
12245
12269
 
12246
12270
  function FillMesh() {
12247
12271
  return _Instanced.apply(this, arguments) || this;
@@ -12424,7 +12448,7 @@
12424
12448
  var vert$3 = "#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = COLOR) in vec4 a_Color;\nlayout(location = STROKE_COLOR) in vec4 a_StrokeColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec2 a_Size;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nvoid main() {\n mat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n#ifdef CLIPSPACE_NEAR_ZERO\n gl_Position.z = gl_Position.z * 0.5 + 0.5;\n#endif\n\n vec2 offset = (a_Uv - u_Anchor.xy) * a_Size;\n\n gl_Position = project(vec4(offset, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n}"; // eslint-disable-line
12425
12449
 
12426
12450
  var ImageMesh = /*#__PURE__*/function (_Instanced) {
12427
- _inheritsLoose$1(ImageMesh, _Instanced);
12451
+ _inheritsLoose$2(ImageMesh, _Instanced);
12428
12452
 
12429
12453
  function ImageMesh() {
12430
12454
  return _Instanced.apply(this, arguments) || this;
@@ -13080,7 +13104,7 @@
13080
13104
  })(TextUniform || (TextUniform = {}));
13081
13105
 
13082
13106
  var TextMesh = /*#__PURE__*/function (_Instanced) {
13083
- _inheritsLoose$1(TextMesh, _Instanced);
13107
+ _inheritsLoose$2(TextMesh, _Instanced);
13084
13108
 
13085
13109
  function TextMesh() {
13086
13110
  var _this;
@@ -13399,7 +13423,7 @@
13399
13423
  TextMesh = __decorate([g.injectable()], TextMesh);
13400
13424
 
13401
13425
  var MeshMesh = /*#__PURE__*/function (_Instanced) {
13402
- _inheritsLoose$1(MeshMesh, _Instanced);
13426
+ _inheritsLoose$2(MeshMesh, _Instanced);
13403
13427
 
13404
13428
  function MeshMesh() {
13405
13429
  return _Instanced.apply(this, arguments) || this;
@@ -13528,7 +13552,7 @@
13528
13552
  */
13529
13553
 
13530
13554
  var CircleRenderer = /*#__PURE__*/function (_Batch) {
13531
- _inheritsLoose$1(CircleRenderer, _Batch);
13555
+ _inheritsLoose$2(CircleRenderer, _Batch);
13532
13556
 
13533
13557
  function CircleRenderer() {
13534
13558
  var _this;
@@ -13596,7 +13620,7 @@
13596
13620
  })], CircleRenderer);
13597
13621
 
13598
13622
  var PathRenderer = /*#__PURE__*/function (_Batch) {
13599
- _inheritsLoose$1(PathRenderer, _Batch);
13623
+ _inheritsLoose$2(PathRenderer, _Batch);
13600
13624
 
13601
13625
  function PathRenderer() {
13602
13626
  var _this;
@@ -13672,7 +13696,7 @@
13672
13696
  // }
13673
13697
 
13674
13698
  var GroupRenderer = /*#__PURE__*/function (_Batch) {
13675
- _inheritsLoose$1(GroupRenderer, _Batch);
13699
+ _inheritsLoose$2(GroupRenderer, _Batch);
13676
13700
 
13677
13701
  function GroupRenderer() {
13678
13702
  var _this;
@@ -13703,7 +13727,7 @@
13703
13727
  })], GroupRenderer);
13704
13728
 
13705
13729
  var ImageRenderer = /*#__PURE__*/function (_Batch) {
13706
- _inheritsLoose$1(ImageRenderer, _Batch);
13730
+ _inheritsLoose$2(ImageRenderer, _Batch);
13707
13731
 
13708
13732
  function ImageRenderer() {
13709
13733
  var _this;
@@ -13734,7 +13758,7 @@
13734
13758
  })], ImageRenderer);
13735
13759
 
13736
13760
  var TextRenderer = /*#__PURE__*/function (_Batch) {
13737
- _inheritsLoose$1(TextRenderer, _Batch);
13761
+ _inheritsLoose$2(TextRenderer, _Batch);
13738
13762
 
13739
13763
  function TextRenderer() {
13740
13764
  var _this;
@@ -13788,7 +13812,7 @@
13788
13812
  */
13789
13813
 
13790
13814
  var LineRenderer = /*#__PURE__*/function (_Batch) {
13791
- _inheritsLoose$1(LineRenderer, _Batch);
13815
+ _inheritsLoose$2(LineRenderer, _Batch);
13792
13816
 
13793
13817
  function LineRenderer() {
13794
13818
  var _this;
@@ -13819,7 +13843,7 @@
13819
13843
  })], LineRenderer);
13820
13844
 
13821
13845
  var MeshRenderer = /*#__PURE__*/function (_Batch) {
13822
- _inheritsLoose$1(MeshRenderer, _Batch);
13846
+ _inheritsLoose$2(MeshRenderer, _Batch);
13823
13847
 
13824
13848
  function MeshRenderer() {
13825
13849
  var _this;
@@ -13846,7 +13870,7 @@
13846
13870
  var _excluded$1 = ["style"];
13847
13871
 
13848
13872
  var Light = /*#__PURE__*/function (_DisplayObject) {
13849
- _inheritsLoose$1(Light, _DisplayObject);
13873
+ _inheritsLoose$2(Light, _DisplayObject);
13850
13874
 
13851
13875
  function Light(_temp) {
13852
13876
  var _ref = _temp === void 0 ? {} : _temp,
@@ -13876,7 +13900,7 @@
13876
13900
  })(FogType || (FogType = {}));
13877
13901
 
13878
13902
  var Fog = /*#__PURE__*/function (_DisplayObject) {
13879
- _inheritsLoose$1(Fog, _DisplayObject);
13903
+ _inheritsLoose$2(Fog, _DisplayObject);
13880
13904
 
13881
13905
  function Fog(_temp) {
13882
13906
  var _ref = _temp === void 0 ? {} : _temp,
@@ -14648,7 +14672,7 @@
14648
14672
  var frag$5 = "#define GLSLIFY 1\nuniform sampler2D u_Texture;\nin vec2 v_TexCoord;\n\nout vec4 outputColor;\n\nvoid main() {\n outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);\n}"; // eslint-disable-line
14649
14673
 
14650
14674
  var CopyProgram = /*#__PURE__*/function (_DeviceProgram) {
14651
- _inheritsLoose$1(CopyProgram, _DeviceProgram);
14675
+ _inheritsLoose$2(CopyProgram, _DeviceProgram);
14652
14676
 
14653
14677
  function CopyProgram() {
14654
14678
  var _this;
@@ -14730,7 +14754,7 @@
14730
14754
  var frag$6 = "#define GLSLIFY 1\nuniform sampler2D u_Texture;\nin vec2 v_TexCoord;\n\nout vec4 outputColor;\n\nfloat MonochromeNTSC(vec3 t_Color) {\n // NTSC primaries.\n return dot(t_Color.rgb, vec3(0.299, 0.587, 0.114));\n}\n\nvec4 FXAA(PD_SAMPLER_2D(t_Texture), in vec2 t_PixelCenter, in vec2 t_InvResolution) {\n // FXAA v2, based on implementations:\n // http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/\n // https://github.com/mitsuhiko/webgl-meincraft\n\n float lumaMM = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy).rgb);\n\n #if 1\n vec2 t_PixelTopLeft = t_PixelCenter.xy - t_InvResolution.xy * 0.5;\n float lumaNW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy) .rgb);\n float lumaNE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(1.0, 0.0)).rgb);\n float lumaSW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(0.0, 1.0)).rgb);\n float lumaSE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(1.0, 1.0)).rgb);\n #else\n // We're at the pixel center -- pixel edges are 0.5 units away.\n // NOTE(jstpierre): mitsuhiko's port seems to get this wrong?\n vec2 t_PixelSize = t_InvResolution.xy * 0.5;\n\n float lumaNW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2(-1.0, -1.0)).rgb);\n float lumaNE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2( 1.0, -1.0)).rgb);\n float lumaSW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2(-1.0, 1.0)).rgb);\n float lumaSE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2( 1.0, 1.0)).rgb);\n #endif\n\n vec2 dir; \n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n const float FXAA_REDUCE_MIN = 1.0/128.0;\n const float FXAA_REDUCE_MUL = 1.0/8.0;\n const float FXAA_SPAN_MAX = 8.0;\n\n float dirReduce = max(\n (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL),\n FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), dir * rcpDirMin)) * u_InvResolution.xy;\n\n float lumaMin = min(lumaMM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaMM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n vec4 rgbA = (1.0/2.0) * (\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (1.0/3.0 - 0.5)) +\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (2.0/3.0 - 0.5)));\n vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (0.0/3.0 - 0.5)) +\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (3.0/3.0 - 0.5)));\n float lumaB = MonochromeNTSC(rgbB.rgb);\n\n vec4 rgbOutput = ((lumaB < lumaMin) || (lumaB > lumaMax)) ? rgbA : rgbB;\n return rgbOutput;\n}\n\nvoid main() {\n outputColor = FXAA(PP_SAMPLER_2D(u_Texture), v_TexCoord.xy, u_InvResolution.xy);\n}"; // eslint-disable-line
14731
14755
 
14732
14756
  var FXAAProgram = /*#__PURE__*/function (_DeviceProgram) {
14733
- _inheritsLoose$1(FXAAProgram, _DeviceProgram);
14757
+ _inheritsLoose$2(FXAAProgram, _DeviceProgram);
14734
14758
 
14735
14759
  function FXAAProgram() {
14736
14760
  var _this;
@@ -14870,29 +14894,37 @@
14870
14894
  });
14871
14895
  });
14872
14896
 
14873
- var Plugin$1 = /*#__PURE__*/function () {
14897
+ var Plugin$1 = /*#__PURE__*/function (_AbstractRendererPlug) {
14898
+ _inheritsLoose$2(Plugin, _AbstractRendererPlug);
14899
+
14874
14900
  function Plugin() {
14875
- this.name = 'device-renderer';
14876
- this.container = void 0;
14901
+ var _this;
14902
+
14903
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14904
+ args[_key] = arguments[_key];
14905
+ }
14906
+
14907
+ _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
14908
+ _this.name = 'device-renderer';
14909
+ return _this;
14877
14910
  }
14878
14911
 
14879
14912
  var _proto = Plugin.prototype;
14880
14913
 
14881
- _proto.init = function init(container) {
14914
+ _proto.init = function init() {
14882
14915
  if (!g.GlobalContainer.isBound(MeshUpdater)) {
14883
14916
  g.GlobalContainer.register(MeshUpdater);
14884
14917
  }
14885
14918
 
14886
- this.container = container;
14887
- container.load(containerModule$1, true);
14919
+ this.container.load(containerModule$1, true);
14888
14920
  };
14889
14921
 
14890
- _proto.destroy = function destroy(container) {
14922
+ _proto.destroy = function destroy() {
14891
14923
  if (g.GlobalContainer.isBound(MeshUpdater)) {
14892
14924
  g.GlobalContainer.remove(MeshUpdater);
14893
14925
  }
14894
14926
 
14895
- container.unload(containerModule$1);
14927
+ this.container.unload(containerModule$1);
14896
14928
  };
14897
14929
 
14898
14930
  _proto.getDevice = function getDevice() {
@@ -14908,7 +14940,7 @@
14908
14940
  };
14909
14941
 
14910
14942
  return Plugin;
14911
- }();
14943
+ }(g.AbstractRendererPlugin);
14912
14944
 
14913
14945
  var index_esm = /*#__PURE__*/Object.freeze({
14914
14946
  __proto__: null,
@@ -15494,6 +15526,21 @@
15494
15526
  };
15495
15527
  }
15496
15528
 
15529
+ function _inheritsLoose$3(subClass, superClass) {
15530
+ subClass.prototype = Object.create(superClass.prototype);
15531
+ subClass.prototype.constructor = subClass;
15532
+
15533
+ _setPrototypeOf$3(subClass, superClass);
15534
+ }
15535
+
15536
+ function _setPrototypeOf$3(o, p) {
15537
+ _setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
15538
+ o.__proto__ = p;
15539
+ return o;
15540
+ };
15541
+ return _setPrototypeOf$3(o, p);
15542
+ }
15543
+
15497
15544
  var _class$2;
15498
15545
 
15499
15546
  var DOMInteractionPlugin_1;
@@ -15660,23 +15707,33 @@
15660
15707
  register(DOMInteractionPlugin);
15661
15708
  });
15662
15709
 
15663
- var Plugin$2 = /*#__PURE__*/function () {
15710
+ var Plugin$2 = /*#__PURE__*/function (_AbstractRendererPlug) {
15711
+ _inheritsLoose$3(Plugin, _AbstractRendererPlug);
15712
+
15664
15713
  function Plugin() {
15665
- this.name = 'dom-interaction';
15714
+ var _this;
15715
+
15716
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15717
+ args[_key] = arguments[_key];
15718
+ }
15719
+
15720
+ _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
15721
+ _this.name = 'dom-interaction';
15722
+ return _this;
15666
15723
  }
15667
15724
 
15668
15725
  var _proto = Plugin.prototype;
15669
15726
 
15670
- _proto.init = function init(container) {
15671
- container.load(containerModule$2, true);
15727
+ _proto.init = function init() {
15728
+ this.container.load(containerModule$2, true);
15672
15729
  };
15673
15730
 
15674
- _proto.destroy = function destroy(container) {
15675
- container.unload(containerModule$2);
15731
+ _proto.destroy = function destroy() {
15732
+ this.container.unload(containerModule$2);
15676
15733
  };
15677
15734
 
15678
15735
  return Plugin;
15679
- }();
15736
+ }(g.AbstractRendererPlugin);
15680
15737
 
15681
15738
  var index_esm$1 = /*#__PURE__*/Object.freeze({
15682
15739
  __proto__: null,
@@ -16069,6 +16126,21 @@
16069
16126
  };
16070
16127
  }
16071
16128
 
16129
+ function _inheritsLoose$4(subClass, superClass) {
16130
+ subClass.prototype = Object.create(superClass.prototype);
16131
+ subClass.prototype.constructor = subClass;
16132
+
16133
+ _setPrototypeOf$4(subClass, superClass);
16134
+ }
16135
+
16136
+ function _setPrototypeOf$4(o, p) {
16137
+ _setPrototypeOf$4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
16138
+ o.__proto__ = p;
16139
+ return o;
16140
+ };
16141
+ return _setPrototypeOf$4(o, p);
16142
+ }
16143
+
16072
16144
  var _class$3;
16073
16145
 
16074
16146
  var HTMLRenderingPlugin_1;
@@ -16337,23 +16409,33 @@
16337
16409
  register(HTMLRenderingPlugin);
16338
16410
  });
16339
16411
 
16340
- var Plugin$3 = /*#__PURE__*/function () {
16412
+ var Plugin$3 = /*#__PURE__*/function (_AbstractRendererPlug) {
16413
+ _inheritsLoose$4(Plugin, _AbstractRendererPlug);
16414
+
16341
16415
  function Plugin() {
16342
- this.name = 'html-renderer';
16416
+ var _this;
16417
+
16418
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
16419
+ args[_key] = arguments[_key];
16420
+ }
16421
+
16422
+ _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
16423
+ _this.name = 'html-renderer';
16424
+ return _this;
16343
16425
  }
16344
16426
 
16345
16427
  var _proto = Plugin.prototype;
16346
16428
 
16347
- _proto.init = function init(container) {
16348
- container.load(containerModule$3, true);
16429
+ _proto.init = function init() {
16430
+ this.container.load(containerModule$3, true);
16349
16431
  };
16350
16432
 
16351
- _proto.destroy = function destroy(container) {
16352
- container.unload(containerModule$3);
16433
+ _proto.destroy = function destroy() {
16434
+ this.container.unload(containerModule$3);
16353
16435
  };
16354
16436
 
16355
16437
  return Plugin;
16356
- }();
16438
+ }(g.AbstractRendererPlugin);
16357
16439
 
16358
16440
  var index_esm$2 = /*#__PURE__*/Object.freeze({
16359
16441
  __proto__: null,
@@ -16763,19 +16845,19 @@
16763
16845
  return _extends$1.apply(this, arguments);
16764
16846
  }
16765
16847
 
16766
- function _inheritsLoose$2(subClass, superClass) {
16848
+ function _inheritsLoose$5(subClass, superClass) {
16767
16849
  subClass.prototype = Object.create(superClass.prototype);
16768
16850
  subClass.prototype.constructor = subClass;
16769
16851
 
16770
- _setPrototypeOf$2(subClass, superClass);
16852
+ _setPrototypeOf$5(subClass, superClass);
16771
16853
  }
16772
16854
 
16773
- function _setPrototypeOf$2(o, p) {
16774
- _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
16855
+ function _setPrototypeOf$5(o, p) {
16856
+ _setPrototypeOf$5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
16775
16857
  o.__proto__ = p;
16776
16858
  return o;
16777
16859
  };
16778
- return _setPrototypeOf$2(o, p);
16860
+ return _setPrototypeOf$5(o, p);
16779
16861
  }
16780
16862
 
16781
16863
  function _assertThisInitialized$1(self) {
@@ -17436,7 +17518,7 @@
17436
17518
  }
17437
17519
 
17438
17520
  var ResourceBase_WebGPU = /*#__PURE__*/function (_EventEmitter) {
17439
- _inheritsLoose$2(ResourceBase_WebGPU, _EventEmitter);
17521
+ _inheritsLoose$5(ResourceBase_WebGPU, _EventEmitter);
17440
17522
 
17441
17523
  function ResourceBase_WebGPU(_ref) {
17442
17524
  var _this;
@@ -17461,7 +17543,7 @@
17461
17543
  }(eventemitter3.EventEmitter);
17462
17544
 
17463
17545
  var Bindings_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17464
- _inheritsLoose$2(Bindings_WebGPU, _ResourceBase_WebGPU);
17546
+ _inheritsLoose$5(Bindings_WebGPU, _ResourceBase_WebGPU);
17465
17547
 
17466
17548
  function Bindings_WebGPU(_ref) {
17467
17549
  var _this;
@@ -17558,7 +17640,7 @@
17558
17640
  }
17559
17641
 
17560
17642
  var Buffer_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17561
- _inheritsLoose$2(Buffer_WebGPU, _ResourceBase_WebGPU);
17643
+ _inheritsLoose$5(Buffer_WebGPU, _ResourceBase_WebGPU);
17562
17644
  /**
17563
17645
  * @see https://www.w3.org/TR/webgpu/#gpubuffer
17564
17646
  */
@@ -17715,7 +17797,7 @@
17715
17797
  }();
17716
17798
 
17717
17799
  var ComputePipeline_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17718
- _inheritsLoose$2(ComputePipeline_WebGPU, _ResourceBase_WebGPU);
17800
+ _inheritsLoose$5(ComputePipeline_WebGPU, _ResourceBase_WebGPU);
17719
17801
 
17720
17802
  function ComputePipeline_WebGPU(_ref) {
17721
17803
  var _this;
@@ -17758,7 +17840,7 @@
17758
17840
  }(ResourceBase_WebGPU);
17759
17841
 
17760
17842
  var InputLayout_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17761
- _inheritsLoose$2(InputLayout_WebGPU, _ResourceBase_WebGPU);
17843
+ _inheritsLoose$5(InputLayout_WebGPU, _ResourceBase_WebGPU);
17762
17844
 
17763
17845
  function InputLayout_WebGPU(_ref) {
17764
17846
  var _this;
@@ -17811,7 +17893,7 @@
17811
17893
  }(ResourceBase_WebGPU);
17812
17894
 
17813
17895
  var InputState_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17814
- _inheritsLoose$2(InputState_WebGPU, _ResourceBase_WebGPU);
17896
+ _inheritsLoose$5(InputState_WebGPU, _ResourceBase_WebGPU);
17815
17897
 
17816
17898
  function InputState_WebGPU(_ref) {
17817
17899
  var _this;
@@ -17839,7 +17921,7 @@
17839
17921
  }(ResourceBase_WebGPU);
17840
17922
 
17841
17923
  var Program_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17842
- _inheritsLoose$2(Program_WebGPU, _ResourceBase_WebGPU);
17924
+ _inheritsLoose$5(Program_WebGPU, _ResourceBase_WebGPU);
17843
17925
 
17844
17926
  function Program_WebGPU(_ref) {
17845
17927
  var _this;
@@ -17919,7 +18001,7 @@
17919
18001
  }(ResourceBase_WebGPU);
17920
18002
 
17921
18003
  var QueryPool_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17922
- _inheritsLoose$2(QueryPool_WebGPU, _ResourceBase_WebGPU);
18004
+ _inheritsLoose$5(QueryPool_WebGPU, _ResourceBase_WebGPU);
17923
18005
 
17924
18006
  function QueryPool_WebGPU(_ref) {
17925
18007
  var _this;
@@ -17952,7 +18034,7 @@
17952
18034
  }(ResourceBase_WebGPU);
17953
18035
 
17954
18036
  var Readback_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
17955
- _inheritsLoose$2(Readback_WebGPU, _ResourceBase_WebGPU);
18037
+ _inheritsLoose$5(Readback_WebGPU, _ResourceBase_WebGPU);
17956
18038
 
17957
18039
  function Readback_WebGPU(_ref) {
17958
18040
  var _this;
@@ -18553,7 +18635,7 @@
18553
18635
  }();
18554
18636
 
18555
18637
  var RenderPipeline_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
18556
- _inheritsLoose$2(RenderPipeline_WebGPU, _ResourceBase_WebGPU);
18638
+ _inheritsLoose$5(RenderPipeline_WebGPU, _ResourceBase_WebGPU);
18557
18639
 
18558
18640
  function RenderPipeline_WebGPU(_ref) {
18559
18641
  var _this;
@@ -18587,7 +18669,7 @@
18587
18669
  }(ResourceBase_WebGPU);
18588
18670
 
18589
18671
  var Sampler_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
18590
- _inheritsLoose$2(Sampler_WebGPU, _ResourceBase_WebGPU); // @see https://www.w3.org/TR/webgpu/#gpusampler
18672
+ _inheritsLoose$5(Sampler_WebGPU, _ResourceBase_WebGPU); // @see https://www.w3.org/TR/webgpu/#gpusampler
18591
18673
 
18592
18674
 
18593
18675
  function Sampler_WebGPU(_ref) {
@@ -18626,7 +18708,7 @@
18626
18708
  }(ResourceBase_WebGPU);
18627
18709
 
18628
18710
  var Texture_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
18629
- _inheritsLoose$2(Texture_WebGPU, _ResourceBase_WebGPU);
18711
+ _inheritsLoose$5(Texture_WebGPU, _ResourceBase_WebGPU);
18630
18712
 
18631
18713
  function Texture_WebGPU(_ref) {
18632
18714
  var _this;
@@ -19391,33 +19473,39 @@
19391
19473
  register(WebGPUDeviceContribution);
19392
19474
  });
19393
19475
 
19394
- var Plugin$4 = /*#__PURE__*/function () {
19476
+ var Plugin$4 = /*#__PURE__*/function (_AbstractRendererPlug) {
19477
+ _inheritsLoose$5(Plugin, _AbstractRendererPlug);
19478
+
19395
19479
  function Plugin(options) {
19480
+ var _this;
19481
+
19396
19482
  if (options === void 0) {
19397
19483
  options = {};
19398
19484
  }
19399
19485
 
19400
- this.options = void 0;
19401
- this.name = 'webgpu-device';
19402
- this.options = options;
19486
+ _this = _AbstractRendererPlug.call(this) || this;
19487
+ _this.options = void 0;
19488
+ _this.name = 'webgpu-device';
19489
+ _this.options = options;
19490
+ return _this;
19403
19491
  }
19404
19492
 
19405
19493
  var _proto = Plugin.prototype;
19406
19494
 
19407
- _proto.init = function init(container) {
19408
- container.register(WebGPUDeviceOptions, {
19495
+ _proto.init = function init() {
19496
+ this.container.register(WebGPUDeviceOptions, {
19409
19497
  useValue: _extends$1({}, this.options)
19410
19498
  });
19411
- container.load(containerModule$4, true);
19499
+ this.container.load(containerModule$4, true);
19412
19500
  };
19413
19501
 
19414
- _proto.destroy = function destroy(container) {
19415
- container.remove(WebGPUDeviceOptions);
19416
- container.unload(containerModule$4);
19502
+ _proto.destroy = function destroy() {
19503
+ this.container.remove(WebGPUDeviceOptions);
19504
+ this.container.unload(containerModule$4);
19417
19505
  };
19418
19506
 
19419
19507
  return Plugin;
19420
- }();
19508
+ }(g.AbstractRendererPlugin);
19421
19509
 
19422
19510
  var index_esm$3 = /*#__PURE__*/Object.freeze({
19423
19511
  __proto__: null,
@@ -19577,29 +19665,35 @@
19577
19665
  */
19578
19666
  register(WebGPUContextService);
19579
19667
  });
19580
- var ContextRegisterPlugin = /*#__PURE__*/function () {
19668
+ var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
19669
+ _inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
19670
+
19581
19671
  function ContextRegisterPlugin(rendererPlugin) {
19582
- this.rendererPlugin = void 0;
19583
- this.name = 'webgpu-context-register';
19584
- this.rendererPlugin = rendererPlugin;
19672
+ var _this;
19673
+
19674
+ _this = _AbstractRendererPlug.call(this) || this;
19675
+ _this.rendererPlugin = void 0;
19676
+ _this.name = 'webgpu-context-register';
19677
+ _this.rendererPlugin = rendererPlugin;
19678
+ return _this;
19585
19679
  }
19586
19680
 
19587
19681
  var _proto = ContextRegisterPlugin.prototype;
19588
19682
 
19589
- _proto.init = function init(container) {
19590
- container.register(DeviceRendererPlugin, {
19683
+ _proto.init = function init() {
19684
+ this.container.register(DeviceRendererPlugin, {
19591
19685
  useValue: this.rendererPlugin
19592
19686
  });
19593
- container.load(containerModule$5, true);
19687
+ this.container.load(containerModule$5, true);
19594
19688
  };
19595
19689
 
19596
- _proto.destroy = function destroy(container) {
19597
- container.unload(containerModule$5);
19598
- container.remove(DeviceRendererPlugin);
19690
+ _proto.destroy = function destroy() {
19691
+ this.container.unload(containerModule$5);
19692
+ this.container.remove(DeviceRendererPlugin);
19599
19693
  };
19600
19694
 
19601
19695
  return ContextRegisterPlugin;
19602
- }();
19696
+ }(g.AbstractRendererPlugin);
19603
19697
 
19604
19698
  var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
19605
19699
  _inheritsLoose(Renderer, _AbstractRenderer);