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