WebGL / Address review comments

This commit is contained in:
Olivier Guyot
2022-06-08 10:28:00 +02:00
parent f603ce7456
commit 6848df97f8
4 changed files with 7 additions and 9 deletions

View File

@@ -81,7 +81,7 @@ class AbstractBatchRenderer {
frameState,
createTransform()
);
this.generateRenderInstructions_(batch);
this.generateRenderInstructions(batch);
this.generateBuffers_(batch, geometryType, callback);
}
@@ -115,7 +115,7 @@ class AbstractBatchRenderer {
* @param {import("./MixedGeometryBatch.js").GeometryBatch} batch Geometry batch
* @protected
*/
generateRenderInstructions_(batch) {
generateRenderInstructions(batch) {
abstract();
}
@@ -125,7 +125,7 @@ class AbstractBatchRenderer {
* @param {import("./MixedGeometryBatch.js").GeometryBatch} batch Geometry batch
* @param {import("../../geom/GeometryType.js").default} geometryType Geometry type
* @param {function(): void} callback Function called once the render buffers are updated
* @protected
* @private
*/
generateBuffers_(batch, geometryType, callback) {
const messageId = workerMessageCounter++;
@@ -153,8 +153,6 @@ class AbstractBatchRenderer {
renderInstructionsTransform: batch.renderInstructionsTransform,
customAttributesCount: this.customAttributes_.length,
};
// additional properties will be sent back as-is by the worker
message['projectionTransform'] = batch.renderInstructionsTransform;
this.worker_.postMessage(message, [batch.renderInstructions.buffer]);
// leave ownership of render instructions
@@ -177,7 +175,7 @@ class AbstractBatchRenderer {
this.worker_.removeEventListener('message', handleMessage);
// store transform & invert transform for webgl buffers
batch.verticesBufferTransform = received.projectionTransform;
batch.verticesBufferTransform = received.renderInstructionsTransform;
makeInverseTransform(
batch.invertVerticesBufferTransform,
batch.verticesBufferTransform

View File

@@ -50,7 +50,7 @@ class LineStringBatchRenderer extends AbstractBatchRenderer {
* @param {import("./MixedGeometryBatch.js").LineStringGeometryBatch} batch Linestring geometry batch
* @override
*/
generateRenderInstructions_(batch) {
generateRenderInstructions(batch) {
// here we anticipate the amount of render instructions for lines:
// 2 instructions per vertex for position (x and y)
// + 1 instruction per line per custom attributes

View File

@@ -46,7 +46,7 @@ class PointBatchRenderer extends AbstractBatchRenderer {
* @param {import("./MixedGeometryBatch.js").PointGeometryBatch} batch Point geometry batch
* @override
*/
generateRenderInstructions_(batch) {
generateRenderInstructions(batch) {
// here we anticipate the amount of render instructions for points:
// 2 instructions per vertex for position (x and y)
// + 1 instruction per vertex per custom attributes

View File

@@ -40,7 +40,7 @@ class PolygonBatchRenderer extends AbstractBatchRenderer {
* @param {import("./MixedGeometryBatch.js").PolygonGeometryBatch} batch Polygon geometry batch
* @override
*/
generateRenderInstructions_(batch) {
generateRenderInstructions(batch) {
// here we anticipate the amount of render instructions for polygons:
// 2 instructions per vertex for position (x and y)
// + 1 instruction per polygon per custom attributes