[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.
This commit is contained in:
Ivo van Dongen
2017-08-31 15:42:28 +03:00
committed by Ivo van Dongen
parent 377faaf4f8
commit 4c96603eb6
2 changed files with 4 additions and 5 deletions

View File

@@ -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,

View File

@@ -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);