summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-08-30 15:57:30 +0300
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-08-30 13:26:13 +0000
commit7738ed4a18699d9d96f14dfe08dcc5ddfacf848f (patch)
tree73ff23ccf38874620358d4658bbebd846af29d94 /src
parent3856f0185442b5c4b85c770888072db0bc3fff1a (diff)
downloadqtlocation-7738ed4a18699d9d96f14dfe08dcc5ddfacf848f.tar.gz
Fix broken native text rendering with Mapbox GL plugin
Mapbox is "leaking" the pixel storage mode. So we need to restore it after we render otherwise it breaks native text rendering. Task-number: QTBUG-62861 Change-Id: I12643e34e462cce58cdf30da52ab927499f38442 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
index 3f31997c..82aa868f 100644
--- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
+++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
@@ -88,10 +88,16 @@ void QSGMapboxGLTextureNode::render(QQuickWindow *window)
QOpenGLFunctions *f = window->openglContext()->functions();
f->glViewport(0, 0, m_fbo->width(), m_fbo->height());
+ GLint alignment;
+ f->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
+
m_fbo->bind();
m_map->render();
m_fbo->release();
+ // QTBUG-62861
+ f->glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
+
window->resetOpenGLState();
markDirty(QSGNode::DirtyMaterial);
}
@@ -125,7 +131,13 @@ void QSGMapboxGLRenderNode::render(const RenderState *state)
f->glScissor(state->scissorRect().x(), state->scissorRect().y(), state->scissorRect().width(), state->scissorRect().height());
f->glEnable(GL_SCISSOR_TEST);
+ GLint alignment;
+ f->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
+
m_map->render();
+
+ // QTBUG-62861
+ f->glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
}
QSGRenderNode::StateFlags QSGMapboxGLRenderNode::changedStates() const