summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-06-04 18:13:26 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-06-05 17:47:57 +0300
commit967fc73c153e4844ff0f3b574264bf3ab9f82e8f (patch)
treedf75d8af8a6dbd2aaac06b646512b0ceaac8889b
parenta0503f3f5b1e480df639e4f21d49e519bb721c4b (diff)
downloadqtlocation-mapboxgl-967fc73c153e4844ff0f3b574264bf3ab9f82e8f.tar.gz
Add documentation for TileData::State
-rw-r--r--src/mbgl/map/tile_data.hpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/mbgl/map/tile_data.hpp b/src/mbgl/map/tile_data.hpp
index 2b237a61cb..97852c5cd2 100644
--- a/src/mbgl/map/tile_data.hpp
+++ b/src/mbgl/map/tile_data.hpp
@@ -25,9 +25,42 @@ class TransformState;
class TileData : private util::noncopyable {
public:
+ // initial:
+ // Initial state, only used when the TileData object is created.
+ //
+ // invalid:
+ // FIXME: This state has a bit of overlap with 'initial' and 'obsolete'.
+ //
+ // We report TileData being 'invalid' on Source::hasTile if we don't have the
+ // TileData yet, then Source creates a request. This is misleading because
+ // the TileData object is not effectively on the 'invalid' state and will
+ // cause tiles on 'invalid' state to get reloaded.
+ //
+ // Raster tiles (only) are changing to 'invalid' on error, which will cause a
+ // re-request of the tile.
+ //
+ // loading:
+ // A request to the FileSource was made for the actual tile data and TileData
+ // is waiting for it to arrive.
+ //
+ // loaded:
+ // The actual tile data has arrived and the tile can be parsed.
+ //
+ // partial:
+ // TileData is partially parsed, some buckets are still waiting for dependencies
+ // to arrive, but it is good for rendering. Partial tiles can also be re-parsed,
+ // but might remain in the same state if dependencies are still missing.
+ //
+ // parsed:
+ // TileData is fully parsed and its contents won't change from this point. This
+ // is the only state which is safe to cache this object.
+ //
+ // obsolete:
+ // The TileData can go to obsolete from any state, due to parsing or loading error,
+ // request cancellation or because the tile is no longer in use.
enum class State {
- invalid,
initial,
+ invalid,
loading,
loaded,
partial,