From e96e60385a064ed84fc3dd4f9220503d4b75ceba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A4=C3=A4tt=C3=A4=20Antti?= Date: Mon, 29 Oct 2018 14:54:52 +0200 Subject: [PATCH 1/2] GLTexture-mark-texture-for-upload-when-it-s-recreate In some cases, a GLTexture will destroy its internal OpenGL texture before recreating it (when it requires a new allocation due to some property change). When this happens, we need to ensure we also request our content data to be uploaded after the new internal OpenGL texture is recreated. Change-Id: Ifd3f8a1e40e5fad63d117417006c65fade5c2b39 Task-number: QTBUG-70551 --- src/render/texture/gltexture.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/render/texture/gltexture.cpp b/src/render/texture/gltexture.cpp index 2571e99..38c7d2f 100644 --- a/src/render/texture/gltexture.cpp +++ b/src/render/texture/gltexture.cpp @@ -187,6 +187,10 @@ QOpenGLTexture* GLTexture::getOrCreateGLTexture() if (testDirtyFlag(Properties)) { delete m_gl; m_gl = nullptr; + // If we are destroyed because of some property change but still our content data + // make sure we are marked for upload + if (m_textureData || !m_imageData.empty()) + needUpload = true; } if (!m_gl) { -- 2.7.1.windows.1