diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-11 09:26:05 +0200 |
---|---|---|
committer | Kim M. Kalland <kim.kalland@nokia.com> | 2011-09-12 13:00:44 +0200 |
commit | 884e0194eecb5d0c13218818972542f87ca46393 (patch) | |
tree | 664b5f428e339162104ea35af87ab1c4b2ac9b27 /src | |
parent | 4f73ff97486f89b8e7aca1ed7d55cf42a644d68b (diff) |
Implement QSGVertexColorMaterial::compare and make the class public
Since the opaque state is just as easily settable through the
Blending flag, we ditch it
Change-Id: I92598e3305bd056fdf0711f1fbd6c1be8bf88275
Reviewed-on: http://codereview.qt-project.org/4628
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/scenegraph/qsgdefaultrectanglenode.cpp | 2 | ||||
-rw-r--r-- | src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp | 14 | ||||
-rw-r--r-- | src/declarative/scenegraph/util/qsgvertexcolormaterial.h (renamed from src/declarative/scenegraph/util/qsgvertexcolormaterial_p.h) | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp b/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp index b49966b296..2905f06489 100644 --- a/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp +++ b/src/declarative/scenegraph/qsgdefaultrectanglenode.cpp @@ -174,7 +174,7 @@ void QSGDefaultRectangleNode::setGradientStops(const QGradientStops &stops) setGeometry(g); setFlag(OwnsGeometry); } - static_cast<QSGVertexColorMaterial *>(material())->setColorsAreOpaque(m_gradient_is_opaque); + static_cast<QSGVertexColorMaterial *>(material())->setFlag(QSGMaterial::Blending, !m_gradient_is_opaque); } m_dirty_geometry = true; diff --git a/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp b/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp index c31e9dc936..26edbc22ca 100644 --- a/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp +++ b/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp @@ -134,20 +134,20 @@ QSGVertexColorMaterial::QSGVertexColorMaterial() } - /*! - Sets if the renderer should treat colors as opaque. + int QSGVertexColorMaterial::compare() const + + As the vertex color material has all its state in the vertex attributes, + all materials will be equal. - Setting this flag can in some cases improve performance. + \internal */ -void QSGVertexColorMaterial::setColorsAreOpaque(bool opaqueHint) +int QSGVertexColorMaterial::compare(const QSGMaterial *other) const { - setFlag(Blending, !opaqueHint); + return 0; } - - /*! \internal */ diff --git a/src/declarative/scenegraph/util/qsgvertexcolormaterial_p.h b/src/declarative/scenegraph/util/qsgvertexcolormaterial.h index 8392ef2155..c244f63834 100644 --- a/src/declarative/scenegraph/util/qsgvertexcolormaterial_p.h +++ b/src/declarative/scenegraph/util/qsgvertexcolormaterial.h @@ -50,12 +50,12 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QSGVertexColorMaterial : public QSGMaterial +class Q_DECLARATIVE_EXPORT QSGVertexColorMaterial : public QSGMaterial { public: QSGVertexColorMaterial(); - void setColorsAreOpaque(bool opaqueHint); + int compare(const QSGMaterial *other) const; protected: virtual QSGMaterialType *type() const; |