diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-07-04 18:31:37 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-07-06 12:32:54 +0200 |
commit | 64a827c3250dda0dd97189abf342e7d3c76fd006 (patch) | |
tree | d3bb8d435e02bc32d0c1aaee3731d356423918f0 /src/mbgl | |
parent | 107622a72ba6929bdd70e42d96c16b62c9f65dd7 (diff) | |
download | qtlocation-mapboxgl-64a827c3250dda0dd97189abf342e7d3c76fd006.tar.gz |
[core] rename getStencils() to getClipIDs() to better reflect what it actually does
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/algorithm/generate_clip_ids.cpp | 16 | ||||
-rw-r--r-- | src/mbgl/algorithm/generate_clip_ids.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/painter.cpp | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/mbgl/algorithm/generate_clip_ids.cpp b/src/mbgl/algorithm/generate_clip_ids.cpp index 74e0ee242f..287d2a408e 100644 --- a/src/mbgl/algorithm/generate_clip_ids.cpp +++ b/src/mbgl/algorithm/generate_clip_ids.cpp @@ -31,14 +31,14 @@ bool ClipIDGenerator::Leaf::operator==(const Leaf& other) const { return children == other.children; } -std::map<UnwrappedTileID, ClipID> ClipIDGenerator::getStencils() const { - std::map<UnwrappedTileID, ClipID> stencils; +std::map<UnwrappedTileID, ClipID> ClipIDGenerator::getClipIDs() const { + std::map<UnwrappedTileID, ClipID> clipIDs; // Merge everything. for (auto& pair : pool) { auto& id = pair.first; auto& leaf = pair.second; - auto res = stencils.emplace(id, leaf.clip); + auto res = clipIDs.emplace(id, leaf.clip); if (!res.second) { // Merge with the existing ClipID when there was already an element with the // same tile ID. @@ -46,14 +46,14 @@ std::map<UnwrappedTileID, ClipID> ClipIDGenerator::getStencils() const { } } - for (auto it = stencils.begin(); it != stencils.end(); ++it) { + for (auto it = clipIDs.begin(); it != clipIDs.end(); ++it) { auto& childId = it->first; auto& childClip = it->second; // Loop through all preceding stencils, and find all parents. for (auto parentIt = std::reverse_iterator<decltype(it)>(it); - parentIt != stencils.rend(); ++parentIt) { + parentIt != clipIDs.rend(); ++parentIt) { auto& parentId = parentIt->first; if (childId.isChildOf(parentId)) { // Once we have a parent, we add the bits that this ID hasn't set yet. @@ -66,11 +66,11 @@ std::map<UnwrappedTileID, ClipID> ClipIDGenerator::getStencils() const { } // Remove tiles that are entirely covered by children. - util::erase_if(stencils, [&](const auto& stencil) { - return algorithm::coveredByChildren(stencil.first, stencils); + util::erase_if(clipIDs, [&](const auto& stencil) { + return algorithm::coveredByChildren(stencil.first, clipIDs); }); - return stencils; + return clipIDs; } } // namespace algorithm diff --git a/src/mbgl/algorithm/generate_clip_ids.hpp b/src/mbgl/algorithm/generate_clip_ids.hpp index 8338c7c145..adcf87a72a 100644 --- a/src/mbgl/algorithm/generate_clip_ids.hpp +++ b/src/mbgl/algorithm/generate_clip_ids.hpp @@ -28,7 +28,7 @@ public: template <typename Renderable> void update(std::vector<std::reference_wrapper<Renderable>> renderables); - std::map<UnwrappedTileID, ClipID> getStencils() const; + std::map<UnwrappedTileID, ClipID> getClipIDs() const; }; } // namespace algorithm diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index 47db8254e2..a3decdb603 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -198,9 +198,9 @@ void Painter::render(RenderStyle& style, const FrameData& frame_, View& view) { MBGL_DEBUG_GROUP(context, "clipping masks"); - for (const auto& stencil : clipIDGenerator.getStencils()) { - MBGL_DEBUG_GROUP(context, std::string{ "mask: " } + util::toString(stencil.first)); - renderClippingMask(stencil.first, stencil.second); + for (const auto& clipID : clipIDGenerator.getClipIDs()) { + MBGL_DEBUG_GROUP(context, std::string{ "mask: " } + util::toString(clipID.first)); + renderClippingMask(clipID.first, clipID.second); } } |