QQuickGridMesh: Avoid a signal connection per mesh instance by just calling the signa...
authorRobin Burchell <robin.burchell@viroteck.net>
Wed, 7 Jan 2015 21:00:00 +0000 (22:00 +0100)
committerRobin Burchell <robin.burchell@viroteck.net>
Fri, 9 Jan 2015 11:41:30 +0000 (12:41 +0100)
This can be instantiated a fair number of times, leading to a lot of signal
connections. Since the signal is so simple, just place a function call inline
and avoid unnecessary allocations.

Change-Id: I031245c46bf797898f22ed991d0e97d73728bdf5
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/items/qquickshadereffectmesh.cpp

index 1eab3b4..4100594 100644 (file)
@@ -59,7 +59,6 @@ QQuickGridMesh::QQuickGridMesh(QObject *parent)
     : QQuickShaderEffectMesh(parent)
     , m_resolution(1, 1)
 {
-    connect(this, SIGNAL(resolutionChanged()), this, SIGNAL(geometryChanged()));
 }
 
 QSGGeometry *QQuickGridMesh::updateGeometry(QSGGeometry *geometry, const QVector<QByteArray> &attributes, const QRectF &srcRect, const QRectF &dstRect)
@@ -204,6 +203,7 @@ void QQuickGridMesh::setResolution(const QSize &res)
     }
     m_resolution = res;
     emit resolutionChanged();
+    emit geometryChanged();
 }
 
 QSize QQuickGridMesh::resolution() const