summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/src/qmapboxgl.cpp9
-rw-r--r--platform/qt/src/qmapboxgl_map_renderer.cpp5
-rw-r--r--platform/qt/src/qmapboxgl_p.hpp1
3 files changed, 11 insertions, 4 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index d584012830..e1fe7f5a37 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -1817,11 +1817,13 @@ void QMapboxGLPrivate::update(std::shared_ptr<mbgl::UpdateParameters> parameters
{
std::lock_guard<std::recursive_mutex> lock(m_mapRendererMutex);
+ m_updateParameters = std::move(parameters);
+
if (!m_mapRenderer) {
return;
}
- m_mapRenderer->updateParameters(std::move(parameters));
+ m_mapRenderer->updateParameters(std::move(m_updateParameters));
requestRendering();
}
@@ -1856,6 +1858,11 @@ void QMapboxGLPrivate::createRenderer()
connect(m_mapRenderer.get(), SIGNAL(needsRendering()), this, SLOT(requestRendering()));
m_mapRenderer->setObserver(m_rendererObserver);
+
+ if (m_updateParameters) {
+ m_mapRenderer->updateParameters(m_updateParameters);
+ requestRendering();
+ }
}
void QMapboxGLPrivate::destroyRenderer()
diff --git a/platform/qt/src/qmapboxgl_map_renderer.cpp b/platform/qt/src/qmapboxgl_map_renderer.cpp
index acc4194498..8c554dab7e 100644
--- a/platform/qt/src/qmapboxgl_map_renderer.cpp
+++ b/platform/qt/src/qmapboxgl_map_renderer.cpp
@@ -71,9 +71,8 @@ void QMapboxGLMapRenderer::render()
// Lock on the parameters
std::lock_guard<std::mutex> lock(m_updateMutex);
- if (!m_updateParameters) {
- return;
- }
+ // UpdateParameters should always be available when rendering.
+ assert(m_updateParameters);
// Hold on to the update parameters during render
params = m_updateParameters;
diff --git a/platform/qt/src/qmapboxgl_p.hpp b/platform/qt/src/qmapboxgl_p.hpp
index b94f4de194..f13c548592 100644
--- a/platform/qt/src/qmapboxgl_p.hpp
+++ b/platform/qt/src/qmapboxgl_p.hpp
@@ -54,6 +54,7 @@ private:
std::recursive_mutex m_mapRendererMutex;
std::shared_ptr<mbgl::RendererObserver> m_rendererObserver;
+ std::shared_ptr<mbgl::UpdateParameters> m_updateParameters;
std::unique_ptr<QMapboxGLMapObserver> m_mapObserver;
std::shared_ptr<mbgl::DefaultFileSource> m_fileSourceObj;