summaryrefslogtreecommitdiffstats
path: root/tests/auto/render
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-07-20 09:45:30 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-07-21 08:10:42 +0000
commita12bc27f19b23177d5a09610fb2e1e2c2e6f1ff7 (patch)
tree854320a06ba0892b9b3e5eb7263ac996e5058661 /tests/auto/render
parentb2a34f74cd9011cdc17609dc3d98335bf7cafd8a (diff)
Fix API consistency in QAttribute
Change-Id: Ifb155a11cd36642ccfa30ec4d597ff72adfc0fc2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/auto/render')
-rw-r--r--tests/auto/render/attribute/tst_attribute.cpp8
-rw-r--r--tests/auto/render/qattribute/tst_qattribute.cpp12
-rw-r--r--tests/auto/render/trianglesextractor/tst_trianglesextractor.cpp28
3 files changed, 24 insertions, 24 deletions
diff --git a/tests/auto/render/attribute/tst_attribute.cpp b/tests/auto/render/attribute/tst_attribute.cpp
index b712bd26a..88861e251 100644
--- a/tests/auto/render/attribute/tst_attribute.cpp
+++ b/tests/auto/render/attribute/tst_attribute.cpp
@@ -50,8 +50,8 @@ private Q_SLOTS:
attribute.setCount(427);
attribute.setDivisor(305);
attribute.setName(QStringLiteral("C3"));
- attribute.setDataType(Qt3DRender::QAttribute::UnsignedShort);
- attribute.setDataSize(3);
+ attribute.setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort);
+ attribute.setVertexSize(3);
Qt3DRender::QBuffer buffer(Qt3DRender::QBuffer::IndexBuffer);
buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy);
@@ -103,8 +103,8 @@ private Q_SLOTS:
attribute.setCount(427);
attribute.setDivisor(305);
attribute.setName(QStringLiteral("C3"));
- attribute.setDataType(Qt3DRender::QAttribute::Double);
- attribute.setDataSize(4);
+ attribute.setVertexBaseType(Qt3DRender::QAttribute::Double);
+ attribute.setVertexSize(4);
Qt3DRender::QBuffer buffer(Qt3DRender::QBuffer::IndexBuffer);
buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy);
buffer.setData(QByteArrayLiteral("C7"));
diff --git a/tests/auto/render/qattribute/tst_qattribute.cpp b/tests/auto/render/qattribute/tst_qattribute.cpp
index 18a11fe4f..ec476cdaa 100644
--- a/tests/auto/render/qattribute/tst_qattribute.cpp
+++ b/tests/auto/render/qattribute/tst_qattribute.cpp
@@ -64,8 +64,8 @@ private Q_SLOTS:
customVertex->setByteOffset(305);
customVertex->setDivisor(235);
customVertex->setName("BB");
- customVertex->setDataType(Qt3DRender::QAttribute::Float);
- customVertex->setDataSize(4);
+ customVertex->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ customVertex->setVertexSize(4);
QTest::newRow("vertex") << customVertex;
Qt3DRender::QAttribute *customIndex = new Qt3DRender::QAttribute();
@@ -77,8 +77,8 @@ private Q_SLOTS:
customIndex->setByteOffset(327);
customIndex->setDivisor(355);
customIndex->setName("SB");
- customIndex->setDataType(Qt3DRender::QAttribute::Float);
- customIndex->setDataSize(3);
+ customIndex->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ customIndex->setVertexSize(3);
QTest::newRow("index") << customIndex;
}
@@ -120,7 +120,7 @@ private Q_SLOTS:
arbiter.setArbiterOnNode(attribute.data());
// WHEN
- attribute->setDataType(Qt3DRender::QAttribute::Double);
+ attribute->setVertexBaseType(Qt3DRender::QAttribute::Double);
QCoreApplication::processEvents();
// THEN
@@ -133,7 +133,7 @@ private Q_SLOTS:
arbiter.events.clear();
// WHEN
- attribute->setDataSize(4);
+ attribute->setVertexSize(4);
QCoreApplication::processEvents();
// THEN
diff --git a/tests/auto/render/trianglesextractor/tst_trianglesextractor.cpp b/tests/auto/render/trianglesextractor/tst_trianglesextractor.cpp
index 8904ccd25..7647b26e7 100644
--- a/tests/auto/render/trianglesextractor/tst_trianglesextractor.cpp
+++ b/tests/auto/render/trianglesextractor/tst_trianglesextractor.cpp
@@ -139,8 +139,8 @@ Qt3DRender::QGeometryRenderer *customIndexedGeometryRenderer()
Qt3DRender::QAttribute *positionAttribute = new Qt3DRender::QAttribute();
positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
positionAttribute->setBuffer(vertexDataBuffer);
- positionAttribute->setDataType(Qt3DRender::QAttribute::Float);
- positionAttribute->setDataSize(3);
+ positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ positionAttribute->setVertexSize(3);
positionAttribute->setByteOffset(0);
positionAttribute->setByteStride(9 * sizeof(float));
positionAttribute->setCount(4);
@@ -149,8 +149,8 @@ Qt3DRender::QGeometryRenderer *customIndexedGeometryRenderer()
Qt3DRender::QAttribute *normalAttribute = new Qt3DRender::QAttribute();
normalAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
normalAttribute->setBuffer(vertexDataBuffer);
- normalAttribute->setDataType(Qt3DRender::QAttribute::Float);
- normalAttribute->setDataSize(3);
+ normalAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ normalAttribute->setVertexSize(3);
normalAttribute->setByteOffset(3 * sizeof(float));
normalAttribute->setByteStride(9 * sizeof(float));
normalAttribute->setCount(4);
@@ -159,8 +159,8 @@ Qt3DRender::QGeometryRenderer *customIndexedGeometryRenderer()
Qt3DRender::QAttribute *colorAttribute = new Qt3DRender::QAttribute();
colorAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
colorAttribute->setBuffer(vertexDataBuffer);
- colorAttribute->setDataType(Qt3DRender::QAttribute::Float);
- colorAttribute->setDataSize(3);
+ colorAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ colorAttribute->setVertexSize(3);
colorAttribute->setByteOffset(6 * sizeof(float));
colorAttribute->setByteStride(9 * sizeof(float));
colorAttribute->setCount(4);
@@ -169,8 +169,8 @@ Qt3DRender::QGeometryRenderer *customIndexedGeometryRenderer()
Qt3DRender::QAttribute *indexAttribute = new Qt3DRender::QAttribute();
indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute);
indexAttribute->setBuffer(indexDataBuffer);
- indexAttribute->setDataType(Qt3DRender::QAttribute::UnsignedShort);
- indexAttribute->setDataSize(1);
+ indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort);
+ indexAttribute->setVertexSize(1);
indexAttribute->setByteOffset(0);
indexAttribute->setByteStride(0);
indexAttribute->setCount(12);
@@ -270,8 +270,8 @@ Qt3DRender::QGeometryRenderer *customNonIndexedGeometryRenderer()
Qt3DRender::QAttribute *positionAttribute = new Qt3DRender::QAttribute();
positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
positionAttribute->setBuffer(vertexDataBuffer);
- positionAttribute->setDataType(Qt3DRender::QAttribute::Float);
- positionAttribute->setDataSize(3);
+ positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ positionAttribute->setVertexSize(3);
positionAttribute->setByteOffset(0);
positionAttribute->setByteStride(9 * sizeof(float));
positionAttribute->setCount(12);
@@ -280,8 +280,8 @@ Qt3DRender::QGeometryRenderer *customNonIndexedGeometryRenderer()
Qt3DRender::QAttribute *normalAttribute = new Qt3DRender::QAttribute();
normalAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
normalAttribute->setBuffer(vertexDataBuffer);
- normalAttribute->setDataType(Qt3DRender::QAttribute::Float);
- normalAttribute->setDataSize(3);
+ normalAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ normalAttribute->setVertexSize(3);
normalAttribute->setByteOffset(3 * sizeof(float));
normalAttribute->setByteStride(9 * sizeof(float));
normalAttribute->setCount(12);
@@ -290,8 +290,8 @@ Qt3DRender::QGeometryRenderer *customNonIndexedGeometryRenderer()
Qt3DRender::QAttribute *colorAttribute = new Qt3DRender::QAttribute();
colorAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
colorAttribute->setBuffer(vertexDataBuffer);
- colorAttribute->setDataType(Qt3DRender::QAttribute::Float);
- colorAttribute->setDataSize(3);
+ colorAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float);
+ colorAttribute->setVertexSize(3);
colorAttribute->setByteOffset(6 * sizeof(float));
colorAttribute->setByteStride(9 * sizeof(float));
colorAttribute->setCount(12);