diff options
author | Ansis Brammanis <ansis@mapbox.com> | 2019-04-01 18:55:30 -0400 |
---|---|---|
committer | Ansis Brammanis <ansis@mapbox.com> | 2019-04-01 22:24:16 -0400 |
commit | 6089031ce340816dadbb99c9eb22d2dd5c2a68a0 (patch) | |
tree | c9bb5b1797e7a933e7d4a34a9da0d1e19cb1b27c /src/mbgl/tile/geometry_tile_worker.cpp | |
parent | a1a0c5f86c0c7cd768e081251145b5261b6be3b3 (diff) | |
download | qtlocation-mapboxgl-6089031ce340816dadbb99c9eb22d2dd5c2a68a0.tar.gz |
icon update improvements
- only reparse tiles when the size of the updated icon is different
- make updates for same-sized icons much faster
- fix crashes
Diffstat (limited to 'src/mbgl/tile/geometry_tile_worker.cpp')
-rw-r--r-- | src/mbgl/tile/geometry_tile_worker.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp index 943e782af1..ebd97f60d0 100644 --- a/src/mbgl/tile/geometry_tile_worker.cpp +++ b/src/mbgl/tile/geometry_tile_worker.cpp @@ -278,12 +278,13 @@ void GeometryTileWorker::onGlyphsAvailable(GlyphMap newGlyphMap) { symbolDependenciesChanged(); } -void GeometryTileWorker::onImagesAvailable(ImageMap newIconMap, ImageMap newPatternMap, uint64_t imageCorrelationID_) { +void GeometryTileWorker::onImagesAvailable(ImageMap newIconMap, ImageMap newPatternMap, std::unordered_map<std::string, uint32_t> newVersionMap, uint64_t imageCorrelationID_) { if (imageCorrelationID != imageCorrelationID_) { return; // Ignore outdated image request replies. } imageMap = std::move(newIconMap); patternMap = std::move(newPatternMap); + versionMap = std::move(newVersionMap); pendingImageDependencies.clear(); symbolDependenciesChanged(); } @@ -441,7 +442,7 @@ void GeometryTileWorker::finalizeLayout() { MBGL_TIMING_START(watch) optional<AlphaImage> glyphAtlasImage; - ImageAtlas iconAtlas = makeImageAtlas(imageMap, patternMap); + ImageAtlas iconAtlas = makeImageAtlas(imageMap, patternMap, versionMap); if (!layouts.empty()) { GlyphAtlas glyphAtlas = makeGlyphAtlas(glyphMap); glyphAtlasImage = std::move(glyphAtlas.image); |