Texture property update: notify frontend only when properties have changed

Change-Id: Ic69b25c92ff45f349715a47b19c3f3c1c40eabea
Reviewed-by: Mike Krus <mike.krus@kdab.com>
This commit is contained in:
Paul Lemire 2018-08-13 15:34:48 +02:00
parent a488e8e371
commit 411c2e9f78
3 changed files with 4 additions and 1 deletions

View File

@ -1271,7 +1271,8 @@ void Renderer::updateGLResources()
// Gather these information and store them to be distributed by a change next frame
const QNodeIdVector referenceTextureIds = glTextureManager->referencedTextureIds(glTexture);
// Store properties and referenceTextureIds
m_updatedTextureProperties.push_back({info.properties, referenceTextureIds});
if (info.wasUpdated)
m_updatedTextureProperties.push_back({info.properties, referenceTextureIds});
}
}
}

View File

@ -211,6 +211,7 @@ GLTexture::TextureUpdateInfo GLTexture::createOrUpdateGLTexture()
if (testDirtyFlag(Properties)) {
delete m_gl;
m_gl = nullptr;
textureInfo.wasUpdated = true;
}

View File

@ -143,6 +143,7 @@ public:
struct TextureUpdateInfo
{
QOpenGLTexture *texture = nullptr;
bool wasUpdated = false;
TextureProperties properties;
};