summaryrefslogtreecommitdiff
path: root/src/mbgl/util/clip_ids.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/util/clip_ids.hpp')
-rw-r--r--src/mbgl/util/clip_ids.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mbgl/util/clip_ids.hpp b/src/mbgl/util/clip_ids.hpp
new file mode 100644
index 0000000000..5855b16af7
--- /dev/null
+++ b/src/mbgl/util/clip_ids.hpp
@@ -0,0 +1,38 @@
+#ifndef MBGL_UTIL_CLIP_IDS
+#define MBGL_UTIL_CLIP_IDS
+
+#include <mbgl/map/tile.hpp>
+#include <list>
+#include <set>
+#include <vector>
+#include <forward_list>
+#include <map>
+
+namespace mbgl {
+
+class ClipIDGenerator {
+private:
+ struct Leaf {
+ Leaf(Tile &tile);
+ void add(const Tile::ID &p);
+ bool operator==(const Leaf &other) const;
+
+ Tile &tile;
+ std::forward_list<Tile::ID> children;
+ };
+
+ typedef std::vector<Leaf> Pool;
+ std::forward_list<Pool> pools;
+ uint8_t bit_offset = 0;
+
+private:
+ bool reuseExisting(Leaf &leaf);
+
+public:
+ void update(std::forward_list<Tile *> tiles);
+};
+
+
+}
+
+#endif