Merge pull request #11901 from ahocevar/vectortile-renderbuffer
Fix handling of VectorTile renderBuffer
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,17 +282,18 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
sourceTileCoord
|
||||
);
|
||||
const sharedExtent = getIntersection(tileExtent, sourceTileExtent);
|
||||
const builderExtent = buffer(
|
||||
sharedExtent,
|
||||
layer.getRenderBuffer() * resolution,
|
||||
this.tmpExtent
|
||||
);
|
||||
const bufferedExtent = equals(sourceTileExtent, sharedExtent)
|
||||
? null
|
||||
: buffer(
|
||||
sharedExtent,
|
||||
layer.getRenderBuffer() * resolution,
|
||||
this.tmpExtent
|
||||
);
|
||||
: builderExtent;
|
||||
builderState.dirty = false;
|
||||
const builderGroup = new CanvasBuilderGroup(
|
||||
0,
|
||||
sharedExtent,
|
||||
builderExtent,
|
||||
resolution,
|
||||
pixelRatio
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user