}
}
#endif
+
+#ifdef QSG_RUNTIME_DESCRIPTION
+ if (d_ptr.isNull())
+ d_ptr.reset(new QSGNodePrivate());
+#endif
}
/*!
}
}
-
+#ifdef QSG_RUNTIME_DESCRIPTION
+void qsgnode_set_description(QSGNode *node, const QString &description)
+{
+ QSGNodePrivate::setDescription(node, description);
+}
+#endif
/*!
\class QSGBasicGeometryNode
QDebug operator<<(QDebug d, const QSGGeometryNode *n)
{
if (!n) {
- d << "QSGGeometryNode(null)";
+ d << "Geometry(null)";
return d;
}
- d << "QSGGeometryNode(" << hex << (void *) n << dec;
+ d << "GeometryNode(" << hex << (void *) n << dec;
const QSGGeometry *g = n->geometry();
default: break;
}
- d << g->vertexCount();
+ d << "#V:" << g->vertexCount() << "#I:" << g->indexCount();
- if (g->attributeCount() > 0 && g->attributes()->type == GL_FLOAT) {
- float x1 = 1e10, x2 = -1e10, y1=1e10, y2=-1e10;
- int stride = g->sizeOfVertex();
- for (int i = 0; i < g->vertexCount(); ++i) {
- float x = ((float *)((char *)const_cast<QSGGeometry *>(g)->vertexData() + i * stride))[0];
- float y = ((float *)((char *)const_cast<QSGGeometry *>(g)->vertexData() + i * stride))[1];
+ if (g->attributeCount() > 0 && g->attributes()->type == GL_FLOAT) {
+ float x1 = 1e10, x2 = -1e10, y1=1e10, y2=-1e10;
+ int stride = g->sizeOfVertex();
+ for (int i = 0; i < g->vertexCount(); ++i) {
+ float x = ((float *)((char *)const_cast<QSGGeometry *>(g)->vertexData() + i * stride))[0];
+ float y = ((float *)((char *)const_cast<QSGGeometry *>(g)->vertexData() + i * stride))[1];
- x1 = qMin(x1, x);
- x2 = qMax(x2, x);
- y1 = qMin(y1, y);
- y2 = qMax(y2, y);
- }
+ x1 = qMin(x1, x);
+ x2 = qMax(x2, x);
+ y1 = qMin(y1, y);
+ y2 = qMax(y2, y);
+ }
- d << "x1=" << x1 << "y1=" << y1 << "x2=" << x2 << "y2=" << y2;
- }
+ d << "x1=" << x1 << "y1=" << y1 << "x2=" << x2 << "y2=" << y2;
+ }
}
- d << "order=" << n->renderOrder();
if (n->material())
- d << "effect=" << n->material() << "type=" << n->material()->type();
+ d << "materialtype=" << n->material()->type();
d << ')';
-#ifdef QML_RUNTIME_TESTING
- d << n->description;
+#ifdef QSG_RUNTIME_DESCRIPTION
+ d << QSGNodePrivate::description(n);
#endif
d << "dirty=" << hex << (int) n->dirtyState() << dec;
return d;
QDebug operator<<(QDebug d, const QSGClipNode *n)
{
if (!n) {
- d << "QSGClipNode(null)";
+ d << "ClipNode(null)";
return d;
}
- d << "QSGClipNode(" << hex << (void *) n << dec;
+ d << "ClipNode(" << hex << (void *) n << dec;
if (n->childCount())
d << "children=" << n->childCount();
d << "is rect?" << (n->isRectangular() ? "yes" : "no");
d << ')';
-#ifdef QML_RUNTIME_TESTING
- d << n->description;
+#ifdef QSG_RUNTIME_DESCRIPTION
+ d << QSGNodePrivate::description(n);
#endif
d << "dirty=" << hex << (int) n->dirtyState() << dec << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
return d;
QDebug operator<<(QDebug d, const QSGTransformNode *n)
{
if (!n) {
- d << "QSGTransformNode(null)";
+ d << "TransformNode(null)";
return d;
}
const QMatrix4x4 m = n->matrix();
- d << "QSGTransformNode(";
+ d << "TransformNode(";
d << hex << (void *) n << dec;
if (m.isIdentity())
d << "identity";
d << "translate" << m(0, 3) << m(1, 3) << m(2, 3);
else
d << "det=" << n->matrix().determinant();
-#ifdef QML_RUNTIME_TESTING
- d << n->description;
+#ifdef QSG_RUNTIME_DESCRIPTION
+ d << QSGNodePrivate::description(n);
#endif
d << "dirty=" << hex << (int) n->dirtyState() << dec << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
d << ')';
QDebug operator<<(QDebug d, const QSGOpacityNode *n)
{
if (!n) {
- d << "QSGOpacityNode(null)";
+ d << "OpacityNode(null)";
return d;
}
- d << "QSGOpacityNode(";
+ d << "OpacityNode(";
d << hex << (void *) n << dec;
d << "opacity=" << n->opacity()
<< "combined=" << n->combinedOpacity()
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
-#ifdef QML_RUNTIME_TESTING
- d << n->description;
+#ifdef QSG_RUNTIME_DESCRIPTION
+ d << QSGNodePrivate::description(n);
#endif
d << "dirty=" << hex << (int) n->dirtyState() << dec;
d << ')';
QDebug operator<<(QDebug d, const QSGRootNode *n)
{
if (!n) {
- d << "QSGRootNode(null)";
+ d << "RootNode(null)";
return d;
}
- d << "QSGRootNode" << hex << (void *) n << "dirty=" << (int) n->dirtyState() << dec
+ d << "RootNode" << hex << (void *) n << "dirty=" << (int) n->dirtyState() << dec
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
-#ifdef QML_RUNTIME_TESTING
- d << n->description;
+#ifdef QSG_RUNTIME_DESCRIPTION
+ d << QSGNodePrivate::description(n);
#endif
d << ')';
return d;
QDebug operator<<(QDebug d, const QSGNode *n)
{
if (!n) {
- d << "QSGNode(null)";
+ d << "Node(null)";
return d;
}
switch (n->type()) {
d << static_cast<const QSGOpacityNode *>(n);
break;
default:
- d << "QSGNode(" << hex << (void *) n << dec
+ d << "Node(" << hex << (void *) n << dec
<< "dirty=" << hex << (int) n->dirtyState()
<< "flags=" << (int) n->flags() << dec
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
-#ifdef QML_RUNTIME_TESTING
- d << n->description;
+#ifdef QSG_RUNTIME_DESCRIPTION
+ d << QSGNodePrivate::description(n);
#endif
d << ')';
break;