@antv/l7-renderer 2.9.23 → 2.9.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/es/regl/ReglModel.js +4 -4
- package/es/regl/index.d.ts +2 -1
- package/es/regl/index.js +18 -6
- package/lib/regl/ReglModel.js +1 -2
- package/lib/regl/index.js +34 -30
- package/package.json +6 -5
package/es/regl/ReglModel.js
CHANGED
|
@@ -58,14 +58,14 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
58
58
|
|
|
59
59
|
if (instances) {
|
|
60
60
|
drawParams.instances = instances;
|
|
61
|
-
} //
|
|
61
|
+
} // Tip:
|
|
62
|
+
// elements 中可能包含 count,此时不应传入
|
|
63
|
+
// count 和 elements 相比、count 优先
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
if (count) {
|
|
65
67
|
drawParams.count = count;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (elements) {
|
|
68
|
+
} else if (elements) {
|
|
69
69
|
drawParams.elements = elements.get();
|
|
70
70
|
}
|
|
71
71
|
|
package/es/regl/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @see https://github.com/regl-project/regl/blob/gh-pages/API.md
|
|
4
4
|
*/
|
|
5
5
|
import { IAttribute, IAttributeInitializationOptions, IBuffer, IBufferInitializationOptions, IClearOptions, IElements, IElementsInitializationOptions, IExtensions, IFramebuffer, IFramebufferInitializationOptions, IModel, IModelInitializationOptions, IReadPixelsOptions, IRenderConfig, IRendererService, ITexture2D, ITexture2DInitializationOptions } from '@antv/l7-core';
|
|
6
|
+
import regl from 'l7regl';
|
|
6
7
|
import 'reflect-metadata';
|
|
7
8
|
import ReglFramebuffer from './ReglFramebuffer';
|
|
8
9
|
/**
|
|
@@ -16,7 +17,7 @@ export default class ReglRendererService implements IRendererService {
|
|
|
16
17
|
private width;
|
|
17
18
|
private height;
|
|
18
19
|
private isDirty;
|
|
19
|
-
init(canvas: HTMLCanvasElement, cfg: IRenderConfig): Promise<void>;
|
|
20
|
+
init(canvas: HTMLCanvasElement, cfg: IRenderConfig, gl?: regl.Regl): Promise<void>;
|
|
20
21
|
getPointSizeRange(): any;
|
|
21
22
|
testExtension(name: string): boolean;
|
|
22
23
|
createModel: (options: IModelInitializationOptions) => IModel;
|
package/es/regl/index.js
CHANGED
|
@@ -160,7 +160,7 @@ var ReglRendererService = (_dec = injectable(), _dec(_class = /*#__PURE__*/funct
|
|
|
160
160
|
_createClass(ReglRendererService, [{
|
|
161
161
|
key: "init",
|
|
162
162
|
value: function () {
|
|
163
|
-
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(canvas, cfg) {
|
|
163
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(canvas, cfg, gl) {
|
|
164
164
|
var _this2 = this;
|
|
165
165
|
|
|
166
166
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -168,9 +168,19 @@ var ReglRendererService = (_dec = injectable(), _dec(_class = /*#__PURE__*/funct
|
|
|
168
168
|
switch (_context.prev = _context.next) {
|
|
169
169
|
case 0:
|
|
170
170
|
// this.$container = $container;
|
|
171
|
-
this.canvas = canvas;
|
|
171
|
+
this.canvas = canvas;
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
if (!gl) {
|
|
174
|
+
_context.next = 5;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
this.gl = gl;
|
|
179
|
+
_context.next = 8;
|
|
180
|
+
break;
|
|
181
|
+
|
|
182
|
+
case 5:
|
|
183
|
+
_context.next = 7;
|
|
174
184
|
return new Promise(function (resolve, reject) {
|
|
175
185
|
regl({
|
|
176
186
|
canvas: _this2.canvas,
|
|
@@ -200,13 +210,15 @@ var ReglRendererService = (_dec = injectable(), _dec(_class = /*#__PURE__*/funct
|
|
|
200
210
|
});
|
|
201
211
|
});
|
|
202
212
|
|
|
203
|
-
case
|
|
213
|
+
case 7:
|
|
204
214
|
this.gl = _context.sent;
|
|
215
|
+
|
|
216
|
+
case 8:
|
|
205
217
|
this.extensionObject = {
|
|
206
218
|
OES_texture_float: this.testExtension('OES_texture_float')
|
|
207
219
|
};
|
|
208
220
|
|
|
209
|
-
case
|
|
221
|
+
case 9:
|
|
210
222
|
case "end":
|
|
211
223
|
return _context.stop();
|
|
212
224
|
}
|
|
@@ -214,7 +226,7 @@ var ReglRendererService = (_dec = injectable(), _dec(_class = /*#__PURE__*/funct
|
|
|
214
226
|
}, _callee, this);
|
|
215
227
|
}));
|
|
216
228
|
|
|
217
|
-
function init(_x, _x2) {
|
|
229
|
+
function init(_x, _x2, _x3) {
|
|
218
230
|
return _init.apply(this, arguments);
|
|
219
231
|
}
|
|
220
232
|
|
package/lib/regl/ReglModel.js
CHANGED
package/lib/regl/index.js
CHANGED
|
@@ -120,39 +120,43 @@ var ReglRendererService = class {
|
|
|
120
120
|
this.gl = null;
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
async init(canvas, cfg) {
|
|
123
|
+
async init(canvas, cfg, gl) {
|
|
124
124
|
this.canvas = canvas;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
125
|
+
if (gl) {
|
|
126
|
+
this.gl = gl;
|
|
127
|
+
} else {
|
|
128
|
+
this.gl = await new Promise((resolve, reject) => {
|
|
129
|
+
(0, import_l7regl.default)({
|
|
130
|
+
canvas: this.canvas,
|
|
131
|
+
attributes: {
|
|
132
|
+
alpha: true,
|
|
133
|
+
antialias: cfg.antialias,
|
|
134
|
+
premultipliedAlpha: true,
|
|
135
|
+
preserveDrawingBuffer: cfg.preserveDrawingBuffer,
|
|
136
|
+
stencil: cfg.stencil
|
|
137
|
+
},
|
|
138
|
+
extensions: [
|
|
139
|
+
"OES_element_index_uint",
|
|
140
|
+
"OES_standard_derivatives",
|
|
141
|
+
"ANGLE_instanced_arrays"
|
|
142
|
+
],
|
|
143
|
+
optionalExtensions: [
|
|
144
|
+
"oes_texture_float_linear",
|
|
145
|
+
"OES_texture_float",
|
|
146
|
+
"EXT_texture_filter_anisotropic",
|
|
147
|
+
"EXT_blend_minmax",
|
|
148
|
+
"WEBGL_depth_texture"
|
|
149
|
+
],
|
|
150
|
+
profile: true,
|
|
151
|
+
onDone: (err, r) => {
|
|
152
|
+
if (err || !r) {
|
|
153
|
+
reject(err);
|
|
154
|
+
}
|
|
155
|
+
resolve(r);
|
|
151
156
|
}
|
|
152
|
-
|
|
153
|
-
}
|
|
157
|
+
});
|
|
154
158
|
});
|
|
155
|
-
}
|
|
159
|
+
}
|
|
156
160
|
this.extensionObject = {
|
|
157
161
|
OES_texture_float: this.testExtension("OES_texture_float")
|
|
158
162
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-renderer",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -25,18 +25,19 @@
|
|
|
25
25
|
"author": "xiaoiver",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"
|
|
28
|
+
"@antv/l7-test-utils": "2.9.25",
|
|
29
|
+
"gl": "^5.0.3"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@antv/l7-core": "2.9.
|
|
32
|
-
"@antv/l7-utils": "2.9.
|
|
32
|
+
"@antv/l7-core": "2.9.25",
|
|
33
|
+
"@antv/l7-utils": "2.9.25",
|
|
33
34
|
"@babel/runtime": "^7.7.7",
|
|
34
35
|
"inversify": "^5.0.1",
|
|
35
36
|
"l7regl": "^0.0.20",
|
|
36
37
|
"lodash": "^4.17.15",
|
|
37
38
|
"reflect-metadata": "^0.1.13"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "fe8fde9091697af0b11e0fe5713ffef7c71405be",
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
|
42
43
|
}
|