summaryrefslogtreecommitdiff
path: root/src/mbgl/style/source.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-14 10:51:25 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-14 11:25:45 -0700
commit98357ab68e3f8513065dfeb86aff94225288166f (patch)
treef18680864008406ebbc4dca9b8b271d6ec1d4fc9 /src/mbgl/style/source.cpp
parent5bbcca832660f80c42e8bfdb5d1836ea8113bb19 (diff)
downloadqtlocation-mapboxgl-98357ab68e3f8513065dfeb86aff94225288166f.tar.gz
[core] Add Source::startRender for parallelism with finishRender
Diffstat (limited to 'src/mbgl/style/source.cpp')
-rw-r--r--src/mbgl/style/source.cpp14
1 files changed, 12 insertions, 2 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);