summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-26 12:22:00 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-26 12:22:38 +0200
commitd340bf2be1738f3d47bc455ea122aef9a9e1c11d (patch)
tree34d060b00cf14924d50c6419e9678804d9f62e58 /src/plugins/geoservices
parent66a6e238876cc1201c5fe331c165ceba458dc56a (diff)
parent592c381564e3f12b79a3d5e9fec5aec2b8045742 (diff)
downloadqtlocation-d340bf2be1738f3d47bc455ea122aef9a9e1c11d.tar.gz
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta3
Conflicts: .qmake.conf Change-Id: I9a3d7ec0bb203ac8b5bd483af3973510ca33c4a9
Diffstat (limited to 'src/plugins/geoservices')
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
index 8df00905..dd5c9a86 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
@@ -97,23 +97,26 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w
}
QMapboxGL *map = 0;
- if (m_useFBO) {
- if (!node) {
+ if (!node) {
+ QOpenGLContext *currentCtx = QOpenGLContext::currentContext();
+ if (!currentCtx) {
+ qWarning("QOpenGLContext is NULL!");
+ return node;
+ }
+ if (m_useFBO) {
QSGMapboxGLTextureNode *mbglNode = new QSGMapboxGLTextureNode(m_settings, m_viewportSize, window->devicePixelRatio(), q);
QObject::connect(mbglNode->map(), &QMapboxGL::mapChanged, q, &QGeoMapMapboxGL::onMapChanged);
m_syncState = MapTypeSync | CameraDataSync | ViewportSync;
node = mbglNode;
- }
- map = static_cast<QSGMapboxGLTextureNode *>(node)->map();
- } else {
- if (!node) {
+ } else {
QSGMapboxGLRenderNode *mbglNode = new QSGMapboxGLRenderNode(m_settings, m_viewportSize, window->devicePixelRatio(), q);
QObject::connect(mbglNode->map(), &QMapboxGL::mapChanged, q, &QGeoMapMapboxGL::onMapChanged);
m_syncState = MapTypeSync | CameraDataSync | ViewportSync;
node = mbglNode;
}
- map = static_cast<QSGMapboxGLRenderNode *>(node)->map();
}
+ map = (m_useFBO) ? static_cast<QSGMapboxGLTextureNode *>(node)->map()
+ : static_cast<QSGMapboxGLRenderNode *>(node)->map();
if (m_syncState & MapTypeSync) {
m_developmentMode = m_activeMapType.name().startsWith("mapbox://")