ensureCanvas takes two arguments, the 2nd the lastRendered time

make the current uses that just pass the 1st argument explictly
set null for the 2nd arg and retain the orig lastRendered time
in that case.

This lastRendered gets overwritten by _tileReady after calling
_applyDelta.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I237d34e8d1fde94c95eb778c054e4ac5985c2a50
private/caolan/emplace_back
Caolán McNamara 2024-05-08 17:13:59 +01:00 committed by Michael Meeks
parent 3dd2087bae
commit cfae2097b1
1 changed files with 6 additions and 5 deletions

View File

@ -6565,7 +6565,8 @@ L.CanvasTileLayer = L.Layer.extend({
this._applyDelta(tile, tile.rawDeltas, true, false);
}
}
tile.lastRendered = now;
if (now !== null)
tile.lastRendered = now;
if (!tile.hasContent())
tile.missingContent++;
},
@ -6674,7 +6675,7 @@ L.CanvasTileLayer = L.Layer.extend({
// important this is after the garbagecollect
if (!tile.canvas)
this.ensureCanvas(tile);
this.ensureCanvas(tile, null);
if ((ctx = tile.canvas.getContext('2d')))
return ctx;
@ -6683,7 +6684,7 @@ L.CanvasTileLayer = L.Layer.extend({
this._garbageCollect();
if (!tile.canvas)
this.ensureCanvas(tile);
this.ensureCanvas(tile, null);
if ((ctx = tile.canvas.getContext('2d')))
return ctx;
@ -6696,7 +6697,7 @@ L.CanvasTileLayer = L.Layer.extend({
this._reclaimTileCanvasMemory(t);
}
if (!tile.canvas)
this.ensureCanvas(tile);
this.ensureCanvas(tile, null);
if ((ctx = tile.canvas.getContext('2d')))
return ctx;
@ -6707,7 +6708,7 @@ L.CanvasTileLayer = L.Layer.extend({
this._reclaimTileCanvasMemory(t);
}
if (!tile.canvas)
this.ensureCanvas(tile);
this.ensureCanvas(tile, null);
ctx = tile.canvas.getContext('2d');
if (!ctx)
window.app.console.log('Error: out of canvas memory.');