diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-30 13:40:36 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-05 19:38:08 -0700 |
commit | 591af0021bfb8b9fdfd803b55fb6c18a24c46943 (patch) | |
tree | b0952184aca90ddda6ce170c4e2cc287824fbf54 /src/mbgl/renderer/tile_pyramid.hpp | |
parent | 32589c271c6f4885dadb6291c4bf637b72659a9f (diff) | |
download | qtlocation-mapboxgl-591af0021bfb8b9fdfd803b55fb6c18a24c46943.tar.gz |
[core] Refactor RenderSource updates
* Eliminate updateBatch in favor of diffing layers and detecting changes to properties upon which layout depends.
* Replace RenderSource::{update,remove,invalidate,reload}Tiles with a single update method
* Replace TilePyramid::{update,remove,invalidate,reload}Tiles with a single update method
* Remove Style& dependency TODO from GeometryTile and TileParameters
Diffstat (limited to 'src/mbgl/renderer/tile_pyramid.hpp')
-rw-r--r-- | src/mbgl/renderer/tile_pyramid.hpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.hpp b/src/mbgl/renderer/tile_pyramid.hpp index a2657c92f2..b99c94d065 100644 --- a/src/mbgl/renderer/tile_pyramid.hpp +++ b/src/mbgl/renderer/tile_pyramid.hpp @@ -5,6 +5,7 @@ #include <mbgl/tile/tile.hpp> #include <mbgl/tile/tile_cache.hpp> #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_impl.hpp> #include <mbgl/util/mat4.hpp> #include <mbgl/util/feature.hpp> @@ -35,23 +36,14 @@ public: bool isLoaded() const; - // Called when the camera has changed. May load new tiles, unload obsolete tiles, or - // trigger re-placement of existing complete tiles. - void updateTiles(const TileParameters&, - SourceType type, - uint16_t tileSize, - Range<uint8_t> zoomRange, - std::function<std::unique_ptr<Tile> (const OverscaledTileID&)> createTile); - - // Removes all tiles (by putting them into the cache). - void removeTiles(); - - // Remove all tiles and clear the cache. - void invalidateTiles(); - - // Request that all loaded tiles re-run the layout operation on the existing source - // data with fresh style information. - void reloadTiles(); + void update(const std::vector<Immutable<style::Layer::Impl>>&, + bool needsRendering, + bool needsRelayout, + const TileParameters&, + SourceType type, + uint16_t tileSize, + Range<uint8_t> zoomRange, + std::function<std::unique_ptr<Tile> (const OverscaledTileID&)> createTile); void startRender(const mat4& projMatrix, const mat4& clipMatrix, |