summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Brock <robert.brock@kdab.com>2016-02-26 09:50:37 +0000
committerSean Harmer <sean.harmer@kdab.com>2016-03-08 13:28:40 +0000
commit2a98c7e7d20bf720c4f4b6444d6317e99face7ec (patch)
tree9c7819883ef88f751beedd8d754c2445064c4edb
parent4301f0c352ad5260536994870a5f1a5c713795a6 (diff)
QPolygonOffset renamed units to depthSteps
Carried changes into the QML examples (planets and shadow map) for both PolygonOffset name changes As per API review Change-Id: Idd2676d53794eb6025696a79ddb59a26ac98b085 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--examples/qt3d/planets-qml/PlanetShadowEffectD.qml2
-rw-r--r--examples/qt3d/shadow-map-qml/AdsEffect.qml4
-rw-r--r--src/plugins/sceneparsers/gltf/gltfparser.cpp2
-rw-r--r--src/render/renderstates/qpolygonoffset.cpp18
-rw-r--r--src/render/renderstates/qpolygonoffset.h8
-rw-r--r--src/render/renderstates/renderstateset.cpp2
6 files changed, 18 insertions, 18 deletions
diff --git a/examples/qt3d/planets-qml/PlanetShadowEffectD.qml b/examples/qt3d/planets-qml/PlanetShadowEffectD.qml
index d1b0c6994..d4ec48090 100644
--- a/examples/qt3d/planets-qml/PlanetShadowEffectD.qml
+++ b/examples/qt3d/planets-qml/PlanetShadowEffectD.qml
@@ -86,7 +86,7 @@ Effect {
}
renderStates: [
- PolygonOffset { scaleFactor: 4; units: 4 },
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
DepthTest { depthFunction: DepthTest.Less }
]
},
diff --git a/examples/qt3d/shadow-map-qml/AdsEffect.qml b/examples/qt3d/shadow-map-qml/AdsEffect.qml
index 537035cdc..4f6910f63 100644
--- a/examples/qt3d/shadow-map-qml/AdsEffect.qml
+++ b/examples/qt3d/shadow-map-qml/AdsEffect.qml
@@ -92,7 +92,7 @@ Effect {
}
renderStates: [
- PolygonOffset { scaleFactor: 4; units: 4 },
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
DepthTest { depthFunction: DepthTest.Less }
]
},
@@ -137,7 +137,7 @@ Effect {
}
renderStates: [
- PolygonOffset { scaleFactor: 4; units: 4 },
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
DepthTest { depthFunction: DepthTest.Less }
]
},
diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp
index 3deafa796..61d3d4d9a 100644
--- a/src/plugins/sceneparsers/gltf/gltfparser.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp
@@ -1538,7 +1538,7 @@ QRenderState* GLTFParser::buildState(const QString& functionName, const QJsonVal
type = GL_POLYGON_OFFSET_FILL;
QPolygonOffset *polygonOffset = new QPolygonOffset;
polygonOffset->setScaleFactor((float)values.at(0).toDouble(0.0f));
- polygonOffset->setUnits((float)values.at(1).toDouble(0.0f));
+ polygonOffset->setDepthSteps((float)values.at(1).toDouble(0.0f));
return polygonOffset;
}
diff --git a/src/render/renderstates/qpolygonoffset.cpp b/src/render/renderstates/qpolygonoffset.cpp
index 73ca8f4fa..f677bd285 100644
--- a/src/render/renderstates/qpolygonoffset.cpp
+++ b/src/render/renderstates/qpolygonoffset.cpp
@@ -50,12 +50,12 @@ public:
QPolygonOffsetPrivate()
: QRenderStatePrivate(QRenderState::PolygonOffset)
, m_scaleFactor(0)
- , m_units(0)
+ , m_depthSteps(0)
{
}
float m_scaleFactor;
- float m_units;
+ float m_depthSteps;
Q_DECLARE_PUBLIC(QPolygonOffset)
};
@@ -85,18 +85,18 @@ void QPolygonOffset::setScaleFactor(float scaleFactor)
}
}
-float QPolygonOffset::units() const
+float QPolygonOffset::depthSteps() const
{
Q_D(const QPolygonOffset);
- return d->m_units;
+ return d->m_depthSteps;
}
-void QPolygonOffset::setUnits(float units)
+void QPolygonOffset::setDepthSteps(float depthSteps)
{
Q_D(QPolygonOffset);
- if (d->m_units != units) {
- d->m_units = units;
- emit unitsChanged(d->m_units);
+ if (d->m_depthSteps != depthSteps) {
+ d->m_depthSteps = depthSteps;
+ emit depthStepsChanged(d->m_depthSteps);
}
}
@@ -105,7 +105,7 @@ void QPolygonOffset::copy(const QNode *ref)
QRenderState::copy(ref);
const QPolygonOffset *refState = static_cast<const QPolygonOffset *>(ref);
d_func()->m_scaleFactor = refState->d_func()->m_scaleFactor;
- d_func()->m_units = refState->d_func()->m_units;
+ d_func()->m_depthSteps = refState->d_func()->m_depthSteps;
}
} // namespace Qt3DRender
diff --git a/src/render/renderstates/qpolygonoffset.h b/src/render/renderstates/qpolygonoffset.h
index 5c147ec8d..dbba09d88 100644
--- a/src/render/renderstates/qpolygonoffset.h
+++ b/src/render/renderstates/qpolygonoffset.h
@@ -53,21 +53,21 @@ class QT3DRENDERSHARED_EXPORT QPolygonOffset : public QRenderState
Q_OBJECT
Q_PROPERTY(float scaleFactor READ scaleFactor WRITE setScaleFactor NOTIFY scaleFactorChanged)
- Q_PROPERTY(float units READ units WRITE setUnits NOTIFY unitsChanged)
+ Q_PROPERTY(float depthSteps READ depthSteps WRITE setDepthSteps NOTIFY depthStepsChanged)
public:
explicit QPolygonOffset(Qt3DCore::QNode *parent = Q_NULLPTR);
~QPolygonOffset();
float scaleFactor() const;
- float units() const;
+ float depthSteps() const;
public Q_SLOTS:
void setScaleFactor(float scaleFactor);
- void setUnits(float units);
+ void setDepthSteps(float depthSteps);
Q_SIGNALS:
void scaleFactorChanged(float scaleFactor);
- void unitsChanged(float units);
+ void depthStepsChanged(float depthSteps);
protected:
void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;
diff --git a/src/render/renderstates/renderstateset.cpp b/src/render/renderstates/renderstateset.cpp
index 0d324b55b..fee781bd6 100644
--- a/src/render/renderstates/renderstateset.cpp
+++ b/src/render/renderstates/renderstateset.cpp
@@ -325,7 +325,7 @@ RenderStateImpl* RenderStateImpl::getOrCreateState(QRenderState *renderState)
case QRenderState::PolygonOffset: {
QPolygonOffset *polygonOffset = static_cast<QPolygonOffset *>(renderState);
return getOrCreateRenderStateImpl<PolygonOffset>(polygonOffset->scaleFactor(),
- polygonOffset->units());
+ polygonOffset->depthSteps());
}
case QRenderState::ColorMask: {
QColorMask *colorMask = static_cast<QColorMask *>(renderState);