diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-01 12:29:17 +0200 |
---|---|---|
committer | Kim M. Kalland <kim.kalland@nokia.com> | 2011-09-01 15:25:18 +0200 |
commit | 6343aea363d2bd885f55339a9aa2f82fb8ec7bf2 (patch) | |
tree | 2d58d9d5140dccc2dc728249f6823b3f06ecf09b /src/declarative/scenegraph/util/qsgflatcolormaterial.cpp | |
parent | 1fc32268c840ca9fa3f6882af0c3e27c611c1232 (diff) |
Add QSGFlatColorMaterial::compare for better sorting
Change-Id: Ic6229c777a30191ba131b3896984da4f3fecc9d5
Reviewed-on: http://codereview.qt.nokia.com/4066
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src/declarative/scenegraph/util/qsgflatcolormaterial.cpp')
-rw-r--r-- | src/declarative/scenegraph/util/qsgflatcolormaterial.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp b/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp index 06ca28aff5..affdcadd3b 100644 --- a/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp +++ b/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp @@ -189,4 +189,12 @@ QSGMaterialShader *QSGFlatColorMaterial::createShader() const return new FlatColorMaterialShader; } + +int QSGFlatColorMaterial::compare(const QSGMaterial *other) const +{ + const QSGFlatColorMaterial *flat = static_cast<const QSGFlatColorMaterial *>(other); + return m_color.rgba() - flat->color().rgba(); + +} + QT_END_NAMESPACE |