25void QSGCurveFillNode::cookGeometry()
27 QSGGeometry *g = geometry();
28 if (g->indexType() != QSGGeometry::UnsignedIntType) {
29 g =
new QSGGeometry(attributes(),
30 m_uncookedVertexes.size(),
31 m_uncookedIndexes.size(),
32 QSGGeometry::UnsignedIntType);
35 g->allocate(m_uncookedVertexes.size(), m_uncookedIndexes.size());
38 g->setDrawingMode(QSGGeometry::DrawTriangles);
39 memcpy(g->vertexData(),
40 m_uncookedVertexes.constData(),
41 g->vertexCount() * g->sizeOfVertex());
42 memcpy(g->indexData(),
43 m_uncookedIndexes.constData(),
44 g->indexCount() * g->sizeOfIndex());
46 m_uncookedIndexes.clear();
47 m_uncookedIndexes.squeeze();
48 m_uncookedVertexes.clear();
49 m_uncookedVertexes.squeeze();
55 QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType, QSGGeometry::PositionAttribute),
56 QSGGeometry::Attribute::createWithAttributeType(1, 3, QSGGeometry::FloatType, QSGGeometry::TexCoordAttribute),
57 QSGGeometry::Attribute::createWithAttributeType(2, 4, QSGGeometry::FloatType, QSGGeometry::UnknownAttribute),
58 QSGGeometry::Attribute::createWithAttributeType(3, 2, QSGGeometry::FloatType, QSGGeometry::UnknownAttribute),
60 static QSGGeometry::AttributeSet attrs = { 4,
sizeof(CurveNodeVertex), data };