From fc345a6c356fdcdd28a67d212bb6750b2f494634 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 2 May 2011 16:58:33 +0200 Subject: Set ChildenDoNotOverlap flag on grids, lists and positioners. QSGGridView, QSGListView, QSGRow, QSGColumn, QSGGrid and QSGFlow now all set the ChildrenDoNotOverlap flag which allows the scene graph to render nodes in a more optimal order. --- src/declarative/items/qsggridview.cpp | 1 + src/declarative/items/qsgitem.cpp | 2 +- src/declarative/items/qsgitem_p.h | 4 +++- src/declarative/items/qsglistview.cpp | 1 + src/declarative/items/qsgpositioners_p_p.h | 1 + src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp | 2 +- src/declarative/scenegraph/coreapi/qsgnode.h | 2 +- 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/declarative/items/qsggridview.cpp b/src/declarative/items/qsggridview.cpp index 9beac05d72..4f00d3651f 100644 --- a/src/declarative/items/qsggridview.cpp +++ b/src/declarative/items/qsggridview.cpp @@ -488,6 +488,7 @@ public: void QSGGridViewPrivate::init() { Q_Q(QSGGridView); + QSGItemPrivate::get(contentItem)->childrenDoNotOverlap = true; QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped())); q->setFlag(QSGItem::ItemIsFocusScope); q->setFlickableDirection(QSGFlickable::VerticalFlick); diff --git a/src/declarative/items/qsgitem.cpp b/src/declarative/items/qsgitem.cpp index b0df6b1a04..f2d26955aa 100644 --- a/src/declarative/items/qsgitem.cpp +++ b/src/declarative/items/qsgitem.cpp @@ -1268,7 +1268,7 @@ QSGItemPrivate::QSGItemPrivate() notifiedActiveFocus(false), filtersChildMouseEvents(false), explicitVisible(true), effectiveVisible(true), explicitEnable(true), effectiveEnable(true), polishScheduled(false), inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true), - inheritMirrorFromParent(false), inheritMirrorFromItem(false), + inheritMirrorFromParent(false), inheritMirrorFromItem(false), childrenDoNotOverlap(false), canvas(0), parentItem(0), diff --git a/src/declarative/items/qsgitem_p.h b/src/declarative/items/qsgitem_p.h index a13fd6a85a..c76eceb674 100644 --- a/src/declarative/items/qsgitem_p.h +++ b/src/declarative/items/qsgitem_p.h @@ -254,7 +254,8 @@ public: bool isMirrorImplicit:1; bool inheritMirrorFromParent:1; bool inheritMirrorFromItem:1; - quint32 dummy:2; + bool childrenDoNotOverlap:1; + quint32 dummy:1; QSGCanvas *canvas; QSGContext *sceneGraphContext() const { return static_cast(QObjectPrivate::get(canvas))->context; } @@ -689,6 +690,7 @@ QSGNode *QSGItemPrivate::childContainerNode() opacityNode->appendChildNode(groupNode); else itemNode()->appendChildNode(groupNode); + groupNode->setFlag(QSGNode::ChildrenDoNotOverlap, childrenDoNotOverlap); #ifdef QML_RUNTIME_TESTING groupNode->description = QLatin1String("group"); #endif diff --git a/src/declarative/items/qsglistview.cpp b/src/declarative/items/qsglistview.cpp index 496fdaf4cc..80cc8be837 100644 --- a/src/declarative/items/qsglistview.cpp +++ b/src/declarative/items/qsglistview.cpp @@ -611,6 +611,7 @@ public: void QSGListViewPrivate::init() { Q_Q(QSGListView); + QSGItemPrivate::get(contentItem)->childrenDoNotOverlap = true; q->setFlag(QSGItem::ItemIsFocusScope); addItemChangeListener(this, Geometry); QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped())); diff --git a/src/declarative/items/qsgpositioners_p_p.h b/src/declarative/items/qsgpositioners_p_p.h index 241cbcfa3c..49de12a1fd 100644 --- a/src/declarative/items/qsgpositioners_p_p.h +++ b/src/declarative/items/qsgpositioners_p_p.h @@ -82,6 +82,7 @@ public: void init(QSGBasePositioner::PositionerType at) { type = at; + childrenDoNotOverlap = true; } int spacing; diff --git a/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp b/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp index 05e502535a..901b84aa09 100644 --- a/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp +++ b/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp @@ -324,7 +324,7 @@ void QMLRenderer::buildLists(QSGNode *node) static bool reorder = !qApp->arguments().contains(QLatin1String("--no-reorder")); #endif - if (reorder && count > 1 && (node->flags() & QSGNode::ChildrenDoNotOverloap)) { + if (reorder && count > 1 && (node->flags() & QSGNode::ChildrenDoNotOverlap)) { QVarLengthArray beginIndices(count); QVarLengthArray endIndices(count); int baseCount = m_transparentNodes.size(); diff --git a/src/declarative/scenegraph/coreapi/qsgnode.h b/src/declarative/scenegraph/coreapi/qsgnode.h index fd2bc82b22..d6700af32e 100644 --- a/src/declarative/scenegraph/coreapi/qsgnode.h +++ b/src/declarative/scenegraph/coreapi/qsgnode.h @@ -99,7 +99,7 @@ public: // Lower 16 bites reserved for general node OwnedByParent = 0x0001, UsePreprocess = 0x0002, - ChildrenDoNotOverloap = 0x0004, + ChildrenDoNotOverlap = 0x0004, // Upper 16 bits reserved for node subclasses -- cgit v1.2.3