aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickshadereffectnode.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2014-08-08 10:57:46 -0500
committerMichael Brasser <michael.brasser@live.com>2014-08-12 00:33:22 +0200
commitfccbe57258c10e18ccdbbec405f5522dbd97af66 (patch)
treef095e612ed57b8a5a3ff028540ce66c63d486715 /src/quick/items/qquickshadereffectnode.cpp
parentaf6ca36c8362bcda4ebe3a3bf369c85aaa98f47c (diff)
Add more complete comparison function to QQuickShaderEffectMaterial.
Task-number: QTBUG-37914 Change-Id: I3646991a9a7e43dcc5681fca0d8a5e24c9a427bd Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquickshadereffectnode.cpp')
-rw-r--r--src/quick/items/qquickshadereffectnode.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/quick/items/qquickshadereffectnode.cpp b/src/quick/items/qquickshadereffectnode.cpp
index 95d4d587a4..df1fceae4c 100644
--- a/src/quick/items/qquickshadereffectnode.cpp
+++ b/src/quick/items/qquickshadereffectnode.cpp
@@ -329,6 +329,11 @@ bool QQuickShaderEffectMaterialKey::operator == (const QQuickShaderEffectMateria
return true;
}
+bool QQuickShaderEffectMaterialKey::operator != (const QQuickShaderEffectMaterialKey &other) const
+{
+ return !(*this == other);
+}
+
uint qHash(const QQuickShaderEffectMaterialKey &key)
{
uint hash = qHash((void *)key.className);
@@ -381,9 +386,13 @@ bool QQuickShaderEffectMaterial::UniformData::operator == (const UniformData &ot
int QQuickShaderEffectMaterial::compare(const QSGMaterial *o) const
{
const QQuickShaderEffectMaterial *other = static_cast<const QQuickShaderEffectMaterial *>(o);
+ if (!supportsAtlasTextures || !other->supportsAtlasTextures)
+ return 1;
+ if (bool(flags() & QSGMaterial::RequiresFullMatrix) || bool(other->flags() & QSGMaterial::RequiresFullMatrix))
+ return 1;
if (cullMode != other->cullMode)
return 1;
- if (supportsAtlasTextures != other->supportsAtlasTextures)
+ if (m_source != other->m_source)
return 1;
for (int shaderType = 0; shaderType < QQuickShaderEffectMaterialKey::ShaderTypeCount; ++shaderType) {
if (uniforms[shaderType] != other->uniforms[shaderType])