diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-11-01 18:18:47 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-11-03 16:14:26 +0000 |
commit | af2ea98b9a7555acf4d0d9c08a2edd489b613e72 (patch) | |
tree | 320f2c3a1d62b72031d56bc3563ee3052cfecab4 /src | |
parent | 148a524565ab69bd494bf0fcddc9c6ef7f965f1b (diff) | |
download | qtlocation-af2ea98b9a7555acf4d0d9c08a2edd489b613e72.tar.gz |
Enable alpha channel in QSGMapboxGLTextureNode
Task-number: QTBUG-64038
Change-Id: Icfa079d181994d8db9bd738bbd6107dce0ea76d1
Reviewed-by: Ola Røer Thorsen <ola@silentwings.no>
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<QSGPlainTexture *>(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(); |