Fix handling of VectorTile renderBuffer

This commit is contained in:
Andreas Hocevar
2021-01-10 17:46:04 +01:00
parent b05db5cca6
commit 1cc9fdb6ec
5 changed files with 70 additions and 19 deletions

View File

@@ -110,9 +110,8 @@ class Executor {
* @param {number} pixelRatio Pixel ratio.
* @param {boolean} overlaps The replay can have overlapping geometries.
* @param {import("../canvas.js").SerializableInstructions} instructions The serializable instructions
* @param {import("../../size.js").Size} renderBuffer Render buffer (width/height) in pixels.
*/
constructor(resolution, pixelRatio, overlaps, instructions, renderBuffer) {
constructor(resolution, pixelRatio, overlaps, instructions) {
/**
* @protected
* @type {boolean}
@@ -156,12 +155,6 @@ class Executor {
*/
this.coordinateCache_ = {};
/**
* @private
* @type {import("../../size.js").Size}
*/
this.renderBuffer_ = renderBuffer;
/**
* @private
* @type {!import("../../transform.js").Transform}

View File

@@ -30,8 +30,8 @@ const ORDER = [
class ExecutorGroup {
/**
* @param {import("../../extent.js").Extent} maxExtent Max extent for clipping. When a
* `maxExtent` was set on the Buillder for this executor group, the same `maxExtent`
* should be set here, unless the target context does not exceet that extent (which
* `maxExtent` was set on the Builder for this executor group, the same `maxExtent`
* should be set here, unless the target context does not exceed that extent (which
* can be the case when rendering to tiles).
* @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
@@ -126,15 +126,13 @@ class ExecutorGroup {
this.executorsByZIndex_[zIndex] = executors;
}
const instructionByZindex = allInstructions[zIndex];
const renderBuffer = [this.renderBuffer_ || 0, this.renderBuffer_ || 0];
for (const builderType in instructionByZindex) {
const instructions = instructionByZindex[builderType];
executors[builderType] = new Executor(
this.resolution_,
this.pixelRatio_,
this.overlaps_,
instructions,
renderBuffer
instructions
);
}
}