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(-) (limited to 'src/plugins/geoservices') 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(-) (limited to 'src/plugins/geoservices') 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/plugins/geoservices/mapboxgl/mapboxgl.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/geoservices') 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 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(-) (limited to 'src/plugins/geoservices') 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 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/plugins/geoservices/mapboxgl/mapboxgl.pro | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/plugins/geoservices') 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