From c0a069904d6dd1495084e4c69dd639dad14fdedd Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Fri, 20 Oct 2017 11:38:17 -0700 Subject: Check if coordinates are non-empty before repeating the first entry Task-number: QTBUG-63926 Change-Id: Ic57090dbc78705893280e040e5b4556cf296f949 Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp index 69bb6e4b..a4d3ed64 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp @@ -124,7 +124,10 @@ QMapbox::Feature featureFromMapPolygon(QDeclarativePolygonMapItem *mapItem) coordinates << QMapbox::Coordinate { coordinate.latitude(), coordinate.longitude() }; } } - coordinates.append(coordinates.first()); + + if (!coordinates.empty()) + coordinates.append(coordinates.first()); // closing the path + QMapbox::CoordinatesCollections geometry { { coordinates } }; return QMapbox::Feature(QMapbox::Feature::PolygonType, geometry, {}, getId(mapItem)); -- cgit v1.2.1 From 467bcda16b0589a75d6b81d4b475a90cecae129d Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 25 Oct 2017 17:24:51 +0300 Subject: Consider map item color alpha channel when applying opacity Task-number: QTBUG-63928 Change-Id: I8b09da92e182dc5464516842718b8d30bc9a48fc Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp index a4d3ed64..f39bfae3 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp @@ -384,7 +384,7 @@ QList> QMapboxGLStyleSetPaintProperty::from const QString id = getId(item); changes << QSharedPointer( - new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity())); + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->color().alphaF() * item->mapItemOpacity())); changes << QSharedPointer( new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color())); changes << QSharedPointer( @@ -401,7 +401,7 @@ QList> QMapboxGLStyleSetPaintProperty::from const QString id = getId(item); changes << QSharedPointer( - new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity())); + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->color().alphaF() * item->mapItemOpacity())); changes << QSharedPointer( new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color())); changes << QSharedPointer( @@ -418,7 +418,7 @@ QList> QMapboxGLStyleSetPaintProperty::from const QString id = getId(item); changes << QSharedPointer( - new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity())); + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->color().alphaF() * item->mapItemOpacity())); changes << QSharedPointer( new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color())); changes << QSharedPointer( @@ -435,7 +435,7 @@ QList> QMapboxGLStyleSetPaintProperty::from const QString id = getId(item); changes << QSharedPointer( - new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("line-opacity"), item->mapItemOpacity())); + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("line-opacity"), item->line()->color().alphaF() * item->mapItemOpacity())); changes << QSharedPointer( new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("line-color"), item->line()->color())); changes << QSharedPointer( -- cgit v1.2.1 From b187e609c152509c30e863ac4662d9a606a53865 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 9 Oct 2017 17:51:21 +0300 Subject: Fix ICU linkage on the Mapbox GL plugin This makes both the Mapbox GL plugin and the Mapbox GL engine at src/3rdparty/mapbox-gl-native use ICU in the same way as qtbase. QMAKE_USE_PRIVATE += icu This should fix build errors when using an ICU that doesn't have headers installed on the default header lookup path. That assumption was specially true for the Mapbox GL engine 3rdparty submodule. Task-number: QTBUG-63571 Change-Id: Id0ab4cb8fb42b8eda8afb9650cd678ee7c5c45ad Reviewed-by: Paolo Angelelli --- src/3rdparty/icu_dependency.pri | 13 ------------- src/3rdparty/mapbox-gl-native | 2 +- src/plugins/geoservices/mapboxgl/mapboxgl.pro | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 src/3rdparty/icu_dependency.pri diff --git a/src/3rdparty/icu_dependency.pri b/src/3rdparty/icu_dependency.pri deleted file mode 100644 index 6318631f..00000000 --- a/src/3rdparty/icu_dependency.pri +++ /dev/null @@ -1,13 +0,0 @@ -win32 { - CONFIG(static, static|shared) { - CONFIG(debug, debug|release) { - LIBS_PRIVATE += -lsicuind -lsicuucd -lsicudtd - } else { - LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt - } - } else { - LIBS_PRIVATE += -licuin -licuuc -licudt - } -} else { - LIBS_PRIVATE += -licui18n -licuuc -licudata -} diff --git a/src/3rdparty/mapbox-gl-native b/src/3rdparty/mapbox-gl-native index 1c633072..a2120304 160000 --- a/src/3rdparty/mapbox-gl-native +++ b/src/3rdparty/mapbox-gl-native @@ -1 +1 @@ -Subproject commit 1c633072fcea7ad153ab6f8ec40dd72d83541ead +Subproject commit a2120304a881507ed60c3199925946c1df06b44c diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index f35f26dc..2cecb820 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -35,7 +35,7 @@ load(qt_build_paths) LIBS_PRIVATE += -L$$MODULE_BASE_OUTDIR/lib -lqmapboxgl$$qtPlatformTargetSuffix() qtConfig(icu) { - include(../../../3rdparty/icu_dependency.pri) + QMAKE_USE_PRIVATE += icu } # When building for Windows with dynamic OpenGL, this plugin -- cgit v1.2.1 From 148a524565ab69bd494bf0fcddc9c6ef7f965f1b Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 27 Oct 2017 13:56:25 +0200 Subject: Fix MapPolygon doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document undefined behavior for less than 3 coordinates Task-number: QTBUG-63929 Change-Id: I3111637c625d6410e8bd58c566f54e3accadc2e3 Reviewed-by: Alex Blasche Reviewed-by: Ola Røer Thorsen Reviewed-by: Bruno de Oliveira Abinader --- src/location/declarativemaps/qdeclarativepolygonmapitem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index b481c64e..7460a376 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -374,6 +374,7 @@ void QDeclarativePolygonMapItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *m This property holds the ordered list of coordinates which define the polygon. + Having less than 3 different coordinates in the path results in undefined behavior. \sa addCoordinate, removeCoordinate */ -- cgit v1.2.1 From af2ea98b9a7555acf4d0d9c08a2edd489b613e72 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 1 Nov 2017 18:18:47 +0200 Subject: Enable alpha channel in QSGMapboxGLTextureNode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-64038 Change-Id: Icfa079d181994d8db9bd738bbd6107dce0ea76d1 Reviewed-by: Ola Røer Thorsen Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp index 82aa868f..7721fe61 100644 --- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp +++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp @@ -68,8 +68,10 @@ void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio) m_map->setFramebufferObject(m_fbo->handle()); QSGPlainTexture *fboTexture = static_cast(texture()); - if (!fboTexture) + if (!fboTexture) { fboTexture = new QSGPlainTexture; + fboTexture->setHasAlphaChannel(true); + } fboTexture->setTextureId(m_fbo->texture()); fboTexture->setTextureSize(fbSize); @@ -92,6 +94,11 @@ void QSGMapboxGLTextureNode::render(QQuickWindow *window) f->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); m_fbo->bind(); + + f->glClearColor(0.f, 0.f, 0.f, 0.f); + f->glColorMask(true, true, true, true); + f->glClear(GL_COLOR_BUFFER_BIT); + m_map->render(); m_fbo->release(); -- cgit v1.2.1 From 5804d34e3b311dc814c7897894ef7a6b960f0f40 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 8 Nov 2017 11:08:41 +0100 Subject: remove use of deprecated QQuickEventPoint::grabber() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It will soon be removed. Change-Id: Id3e348a6e2ef200b1dde7bd87f64b7ca2cffc5cc Reviewed-by: Jan Arve Sæther --- src/location/declarativemaps/qdeclarativegeomap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 7087a50f..34885f54 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -2271,7 +2271,7 @@ bool QDeclarativeGeoMap::sendTouchEvent(QTouchEvent *event) auto touchPointGrabberItem = [touchDevice, windowPriv](const QTouchEvent::TouchPoint &point) -> QQuickItem* { if (QQuickEventPoint *eventPointer = windowPriv->pointerEventInstance(touchDevice)->pointById(point.id())) - return eventPointer->grabber(); + return eventPointer->grabberItem(); return nullptr; }; -- cgit v1.2.1 From 714145e7017afb74a23548ee9df2eff30536cfde Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 7 Nov 2017 10:55:07 -0200 Subject: Fix Mapbox GL plugin OpenGL usage Previously we were linking directly with the OpenGL library available in the system. On Windows for instance the only option was ANGLE. Now Mapbox GL is using OpenGL through QOpenGLFunctions and shall offer much better compatibility. Task-number: QTBUG-62108 Task-number: QTBUG-61767 Task-number: QTBUG-60897 Change-Id: Iabd29ff6c0b6daf14373508d4847344c07d01a57 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff Reviewed-by: Paolo Angelelli --- src/location/configure.json | 2 +- src/location/doc/src/plugins/mapboxgl.qdoc | 2 +- src/plugins/geoservices/mapboxgl/mapboxgl.pro | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/location/configure.json b/src/location/configure.json index 3337b074..4de6e865 100644 --- a/src/location/configure.json +++ b/src/location/configure.json @@ -37,7 +37,7 @@ "condition": [ "features.opengl", "features.c++14", - "!config.qnx && (!config.win32 || (config.mingw && features.angle))" + "!config.qnx && (!config.win32 || config.mingw)" ], "output": [ "privateFeature" ] }, diff --git a/src/location/doc/src/plugins/mapboxgl.qdoc b/src/location/doc/src/plugins/mapboxgl.qdoc index 9099fb39..6593a9e3 100644 --- a/src/location/doc/src/plugins/mapboxgl.qdoc +++ b/src/location/doc/src/plugins/mapboxgl.qdoc @@ -60,7 +60,7 @@ and tiles hosted by Mapbox. To create a Mapbox account visit \l{https://www.mapb Qt Location Mapbox GL Plugin has the following support for platforms: \list - \li Microsoft Windows (win32) - Supported, requires MinGW 5.0+ and ANGLE as OpenGL backend + \li Microsoft Windows (win32) - Supported, requires MinGW 5.0+ \li Linux X11 - Supported, requires GCC 4.9+ \li macOS - Supported \li Android - Supported diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index 2cecb820..17b6f53a 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -38,15 +38,6 @@ qtConfig(icu) { QMAKE_USE_PRIVATE += icu } -# When building for Windows with dynamic OpenGL, this plugin -# can only run with ANGLE because Mapbox GL requires at least -# OpenGL ES and does not use QOpenGLFunctions for resolving -# the OpenGL symbols. -lopengl32 only gives OpenGL 1.1. -win32:qtConfig(dynamicgl) { - qtConfig(combined-angle-lib): LIBS_PRIVATE += -l$${LIBQTANGLE_NAME} - else: LIBS_PRIVATE += -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -} - PLUGIN_TYPE = geoservices PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryMapboxGL load(qt_plugin) -- cgit v1.2.1 From 2abeb49cf87d694d5f8916281f8ede12694742c1 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Mon, 13 Nov 2017 13:02:38 +0200 Subject: Bump Mapbox GL version Bumps Mapbox GL to a new version that fixes the Qt-based database SQLite query binding for text data. Also, replaces 'QImage::byteCount()' with 'QImage::sizeInBytes()' to avoid deprecation warnings in Qt 5.10 onwards. mapbox-gl-native @ 3bef7593a64a51e86dd5a2ed9fd36b4a143350b0 Task-number: QTBUG-63013 Change-Id: I81fb4d8a7cb36fe96e28e28692411460edde5c96 Reviewed-by: Paolo Angelelli --- src/3rdparty/mapbox-gl-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/mapbox-gl-native b/src/3rdparty/mapbox-gl-native index a2120304..572822c8 160000 --- a/src/3rdparty/mapbox-gl-native +++ b/src/3rdparty/mapbox-gl-native @@ -1 +1 @@ -Subproject commit a2120304a881507ed60c3199925946c1df06b44c +Subproject commit 572822c8ca15be190b43afbf7f91d132e988bf21 -- cgit v1.2.1 From 8c42dba3910c0bec3134f57bd5fa466df72d7ba7 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Mon, 13 Nov 2017 14:47:12 +0200 Subject: Update Mapbox GL docs on the db file name Task-number: QTBUG-63013 Change-Id: Ifc232705eec81ec632cb19282cfba02c04ba5ec6 Reviewed-by: Paolo Angelelli Reviewed-by: Thiago Marcos P. Santos --- src/location/doc/src/plugins/mapboxgl.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/location/doc/src/plugins/mapboxgl.qdoc b/src/location/doc/src/plugins/mapboxgl.qdoc index 6593a9e3..8ad6a9c2 100644 --- a/src/location/doc/src/plugins/mapboxgl.qdoc +++ b/src/location/doc/src/plugins/mapboxgl.qdoc @@ -109,6 +109,12 @@ The following table lists optional parameters that can be passed to the Mapbox p but the offline database must be populated using the \l {https://github.com/mapbox/mapbox-gl-native/blob/master/bin/offline.cpp} {offline tool}. The offline database will work alongside with the ambient cache in the same file. Make sure to comply with Mapbox Terms of Service before creating an offline database. + + \b {Note:} The map tile cache file name must be "mapboxgl.db". When using the offline tool, the default + output is "offline.db". For using the generated output from the offline tool, you must move that to the + proper directory, and rename it as "mapboxgl.db". The offline tool also provides the "--output" + parameter for specifying the name of the generated output. + \row \li mapboxgl.mapping.cache.memory \li Whether or not the cache should be in-memory only. Valid values are \b true and \b false. The default -- cgit v1.2.1