summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-08-31 15:42:28 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-08-31 18:45:28 +0300
commit4c96603eb6b4b2f782b33d74cfa94a8c47484a62 (patch)
tree19f4d31bba6c7bfd8b5e55414d049227c4b76886
parent377faaf4f8a5db1f7b31eedaf92d0865cda37db9 (diff)
downloadqtlocation-mapboxgl-4c96603eb6b4b2f782b33d74cfa94a8c47484a62.tar.gz
[core] move annotation tile updates to renderer
- AnnotationData.updateData() was not completely thread safe. Calling it from the renderer thread instead of the main thread fixes this - Since we moved the coalescing of updates out of the map and into the renderer frontend implementations, the updateData was called too much, resulting in degraded performance. Moving it into the renderer makes sure it gets coalesced again.
-rw-r--r--src/mbgl/map/map.cpp6
-rw-r--r--src/mbgl/renderer/renderer_impl.cpp3
2 files changed, 4 insertions, 5 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 8aacce6287..5195dec22d 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -695,15 +695,11 @@ void Map::Impl::onInvalidate() {
onUpdate(Update::Repaint);
}
-void Map::Impl::onUpdate(Update flags) {
+void Map::Impl::onUpdate(Update) {
TimePoint timePoint = mode == MapMode::Continuous ? Clock::now() : Clock::time_point::max();
transform.updateTransitions(timePoint);
- if (flags & Update::AnnotationData) {
- annotationManager.updateData();
- }
-
UpdateParameters params = {
style->impl->isLoaded(),
mode,
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp
index 21ff8ed478..0c292e9830 100644
--- a/src/mbgl/renderer/renderer_impl.cpp
+++ b/src/mbgl/renderer/renderer_impl.cpp
@@ -1,3 +1,4 @@
+#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/renderer/renderer_impl.hpp>
#include <mbgl/renderer/renderer_backend.hpp>
#include <mbgl/renderer/renderer_observer.hpp>
@@ -71,6 +72,8 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
if (updateParameters.mode == MapMode::Still && !updateParameters.stillImageRequest) return;
assert(BackendScope::exists());
+
+ updateParameters.annotationManager.updateData();
const bool zoomChanged = zoomHistory.update(updateParameters.transformState.getZoom(), updateParameters.timePoint);