diff options
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/source.cpp | 14 | ||||
-rw-r--r-- | src/mbgl/style/source.hpp | 15 |
2 files changed, 20 insertions, 9 deletions
diff --git a/src/mbgl/style/source.cpp b/src/mbgl/style/source.cpp index ca0943918b..212d6d5803 100644 --- a/src/mbgl/style/source.cpp +++ b/src/mbgl/style/source.cpp @@ -22,6 +22,8 @@ #include <mbgl/gl/debugging.hpp> #include <mbgl/algorithm/update_renderables.hpp> +#include <mbgl/algorithm/generate_clip_ids.hpp> +#include <mbgl/algorithm/generate_clip_ids_impl.hpp> #include <mapbox/geometry/envelope.hpp> @@ -58,7 +60,15 @@ void Source::invalidateTiles() { cache.clear(); } -void Source::updateMatrices(const mat4 &projMatrix, const TransformState &transform) { +void Source::startRender(algorithm::ClipIDGenerator& generator, + const mat4& projMatrix, + const TransformState& transform) { + if (type == SourceType::Vector || + type == SourceType::GeoJSON || + type == SourceType::Annotations) { + generator.update(renderTiles); + } + for (auto& pair : renderTiles) { auto& tile = pair.second; transform.matrixFor(tile.matrix, tile.id); @@ -66,7 +76,7 @@ void Source::updateMatrices(const mat4 &projMatrix, const TransformState &transf } } -void Source::finishRender(Painter &painter) { +void Source::finishRender(Painter& painter) { for (auto& pair : renderTiles) { auto& tile = pair.second; painter.renderTileDebug(tile); diff --git a/src/mbgl/style/source.hpp b/src/mbgl/style/source.hpp index 575297e326..350534e634 100644 --- a/src/mbgl/style/source.hpp +++ b/src/mbgl/style/source.hpp @@ -23,6 +23,10 @@ class TransformState; class RenderTile; struct ClipID; +namespace algorithm { +class ClipIDGenerator; +} // namespace algorithm + namespace style { class Style; @@ -45,13 +49,10 @@ public: // new data available that a tile in the "partial" state might be interested at. bool update(const UpdateParameters&); - template <typename ClipIDGenerator> - void updateClipIDs(ClipIDGenerator& generator) { - generator.update(renderTiles); - } - - void updateMatrices(const mat4 &projMatrix, const TransformState &transform); - void finishRender(Painter &painter); + void startRender(algorithm::ClipIDGenerator&, + const mat4& projMatrix, + const TransformState&); + void finishRender(Painter&); const std::map<UnwrappedTileID, RenderTile>& getRenderTiles() const; |