Aggregate map chunks in overlay. (#1247)

Overlay rendering performance seemed bottlenecked by drawImage calls. To
reduce both the number of calls and the number of different source
buffers, cache overlay buffers for squares of chunks. This adds a very
small extra cost for updates (one additional drawImage) and some cost
for drawing chunks outside of view, but this is more than made up for by
the savings.

By default, the aggregate are 4x4 squares of chunks.
This commit is contained in:
PFedak 2021-08-25 05:04:52 -06:00 committed by GitHub
parent 2b4eb6771f
commit 6f56d77535
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 271 additions and 60 deletions

View file

@ -55,6 +55,7 @@ export const globalConfig = {
// Map
mapChunkSize: 16,
chunkAggregateSize: 4,
mapChunkOverviewMinZoom: 0.9,
mapChunkWorldSize: null, // COMPUTED