summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2018-08-13 15:34:48 +0200
committerPaul Lemire <paul.lemire@kdab.com>2018-08-14 04:25:18 +0000
commit411c2e9f783272624918a3a72ef61a2266bd7618 (patch)
tree80df4a57828457da3bb56b576052b052a3695d7c
parenta488e8e37130afdbad7ffa4d0972d2708204b431 (diff)
Texture property update: notify frontend only when properties have changed
Change-Id: Ic69b25c92ff45f349715a47b19c3f3c1c40eabea Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r--src/render/renderers/opengl/renderer/renderer.cpp3
-rw-r--r--src/render/renderers/opengl/textures/gltexture.cpp1
-rw-r--r--src/render/renderers/opengl/textures/gltexture_p.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/render/renderers/opengl/renderer/renderer.cpp b/src/render/renderers/opengl/renderer/renderer.cpp
index fd4e7bed4..7319fd0e5 100644
--- a/src/render/renderers/opengl/renderer/renderer.cpp
+++ b/src/render/renderers/opengl/renderer/renderer.cpp
@@ -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});
}
}
}
diff --git a/src/render/renderers/opengl/textures/gltexture.cpp b/src/render/renderers/opengl/textures/gltexture.cpp
index bff0eafee..b61d06a80 100644
--- a/src/render/renderers/opengl/textures/gltexture.cpp
+++ b/src/render/renderers/opengl/textures/gltexture.cpp
@@ -211,6 +211,7 @@ GLTexture::TextureUpdateInfo GLTexture::createOrUpdateGLTexture()
if (testDirtyFlag(Properties)) {
delete m_gl;
m_gl = nullptr;
+ textureInfo.wasUpdated = true;
}
diff --git a/src/render/renderers/opengl/textures/gltexture_p.h b/src/render/renderers/opengl/textures/gltexture_p.h
index 8f9d335df..dd0e05e36 100644
--- a/src/render/renderers/opengl/textures/gltexture_p.h
+++ b/src/render/renderers/opengl/textures/gltexture_p.h
@@ -143,6 +143,7 @@ public:
struct TextureUpdateInfo
{
QOpenGLTexture *texture = nullptr;
+ bool wasUpdated = false;
TextureProperties properties;
};