diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-08-03 01:36:19 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-08-05 15:19:00 +0300 |
commit | fa4636ffe4d2c00446292c229cd549cbaee9e20c (patch) | |
tree | 505e5fdad2051ebc47586e678935b1aa040853db /platform | |
parent | 9fd7e883a7515f97ec4edd097a0db5cbebce3ca1 (diff) | |
download | qtlocation-mapboxgl-fa4636ffe4d2c00446292c229cd549cbaee9e20c.tar.gz |
Map::nudgeTransitions no longer depends on client information
Clients no longer need to provide data (eg. if gesturing or in a custom
animation) to Map::nudgeTransitions().
Upon MapContext::renderSync(), a new atomic bool 'needsRepaint' in MapData
allows thread-safe communication between Map and MapContext.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/glfw_view.cpp | 7 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 10 |
2 files changed, 4 insertions, 13 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 8336b32939..078c26feef 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -336,11 +336,8 @@ void GLFWView::run() { glfwWaitEvents(); const bool dirty = !clean.test_and_set(); if (dirty) { - const bool needsRerender = map->renderSync(); - GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window)); - if (!view->tracking || !view->rotating) { - map->nudgeTransitions(needsRerender); - } + map->renderSync(); + map->nudgeTransitions(); } } } diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index e95305d0c6..81338f2889 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -710,17 +710,11 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) _mbglMap->setSourceTileCacheSize(cacheSize); - bool needsRerender = _mbglMap->renderSync(); + _mbglMap->renderSync(); [self updateUserLocationAnnotationView]; - // don't nudge transitions if in the midst of a gesture. - if (self.pan.state == UIGestureRecognizerStateChanged || - self.pinch.state == UIGestureRecognizerStateChanged || - self.rotate.state == UIGestureRecognizerStateChanged || - self.quickZoom.state == UIGestureRecognizerStateChanged) return; - - _mbglMap->nudgeTransitions(needsRerender); + _mbglMap->nudgeTransitions(); } } |