diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-04-16 17:44:34 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-04-29 11:37:39 +0200 |
commit | 08163713e239ab7756dc9bbe9b6e2c4986f168d3 (patch) | |
tree | 391c7da104dbe3d12fc0152cddaa7dfc8abbea74 /src/mbgl/algorithm/covered_by_children.hpp | |
parent | 8f5e1ba20f7a356c5bdabb7cb9d0d10bb4d73e10 (diff) | |
download | qtlocation-mapboxgl-08163713e239ab7756dc9bbe9b6e2c4986f168d3.tar.gz |
[core] change approach to stencil clipping to (almost) match JS
Diffstat (limited to 'src/mbgl/algorithm/covered_by_children.hpp')
-rw-r--r-- | src/mbgl/algorithm/covered_by_children.hpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/mbgl/algorithm/covered_by_children.hpp b/src/mbgl/algorithm/covered_by_children.hpp deleted file mode 100644 index fe5af3f3db..0000000000 --- a/src/mbgl/algorithm/covered_by_children.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include <mbgl/tile/tile_id.hpp> - -namespace mbgl { -namespace algorithm { - -template <typename Iterator> -bool coveredByChildren(const UnwrappedTileID& id, Iterator it, const Iterator& end) { - for (const auto& child : id.children()) { - it = std::lower_bound(it, end, child, [](const auto& a, const auto& b) { return std::get<0>(a) < b; }); - - // Child is not present, neither its grandchildren. - if (it == end) { - return false; - } - - // Child is not present, but its grandchildren are. - if (std::get<0>(*it) != child) { - // This child is not covered by its grandchildren. - if (!coveredByChildren(child, it, end)) { - return false; - } - } - } - - // We looked at all four children (recursively) and verified that they're covered. - return true; -} - -template <typename Container> -bool coveredByChildren(const UnwrappedTileID& id, const Container& container) { - return coveredByChildren( - id, container.upper_bound(id), - container.lower_bound(UnwrappedTileID{ static_cast<int16_t>(id.wrap + 1), { 0, 0, 0 } })); -} - -} // namespace algorithm -} // namespace mbgl |