525void QQuickWindowPrivate::syncSceneGraph()
529 const bool wasRtDirty = redirect.renderTargetDirty;
530 ensureCustomRenderTarget();
532 QRhiCommandBuffer *cb =
nullptr;
534 if (redirect.commandBuffer)
535 cb = redirect.commandBuffer;
537 cb = swapchain->currentFrameCommandBuffer();
539 context->prepareSync(q->effectiveDevicePixelRatio(), cb, graphicsConfig);
541 animationController->beforeNodeSync();
543 emit q->beforeSynchronizing();
544 runAndClearJobs(&beforeSynchronizingJobs);
546 if (pendingFontUpdate) {
548 invalidateFontData(contentItem);
549 context->invalidateGlyphCaches();
552 if (Q_UNLIKELY(!renderer)) {
553 forceUpdate(contentItem);
555 QSGRootNode *rootNode =
new QSGRootNode;
556 rootNode->appendChildNode(QQuickItemPrivate::get(contentItem)->itemNode());
557 const bool useDepth = graphicsConfig.isDepthBufferEnabledFor2D();
558 const QSGRendererInterface::RenderMode renderMode = useDepth ? QSGRendererInterface::RenderMode2D
559 : QSGRendererInterface::RenderMode2DNoDepthBuffer;
560 renderer = context->createRenderer(renderMode);
561 renderer->setRootNode(rootNode);
562 }
else if (Q_UNLIKELY(wasRtDirty)
563 && q->rendererInterface()->graphicsApi() == QSGRendererInterface::Software) {
564 auto softwareRenderer =
static_cast<QSGSoftwareRenderer *>(renderer);
565 softwareRenderer->markDirty();
570 animationController->afterNodeSync();
572 renderer->setClearColor(clearColor);
574 renderer->setVisualizationMode(visualizationMode);
576 if (pendingFontUpdate) {
577 context->flushGlyphCaches();
578 pendingFontUpdate =
false;
581 emit q->afterSynchronizing();
582 runAndClearJobs(&afterSynchronizingJobs);
621void QQuickWindowPrivate::renderSceneGraph()
627 ensureCustomRenderTarget();
629 QSGRenderTarget sgRenderTarget;
631 QRhiRenderTarget *rt;
632 QRhiRenderPassDescriptor *rp;
633 QRhiCommandBuffer *cb;
634 if (redirect.rt.rt.renderTarget) {
635 rt = redirect.rt.rt.renderTarget;
636 rp = rt->renderPassDescriptor();
638 qWarning(
"Custom render target is set but no renderpass descriptor has been provided.");
641 cb = redirect.commandBuffer;
643 qWarning(
"Custom render target is set but no command buffer has been provided.");
648 qWarning(
"QQuickWindow: No render target (neither swapchain nor custom target was provided)");
651 rt = swapchain->currentFrameRenderTarget();
652 rp = rpDescForSwapchain;
653 cb = swapchain->currentFrameCommandBuffer();
655 sgRenderTarget = QSGRenderTarget(rt, rp, cb);
656 sgRenderTarget.multiViewCount = multiViewCount();
658 sgRenderTarget = QSGRenderTarget(redirect.rt.sw.paintDevice);
661 context->beginNextFrame(renderer,
663 emitBeforeRenderPassRecording,
664 emitAfterRenderPassRecording,
667 animationController->advance();
668 emit q->beforeRendering();
669 runAndClearJobs(&beforeRenderingJobs);
671 const qreal devicePixelRatio = q->effectiveDevicePixelRatio();
673 if (redirect.rt.rt.renderTarget)
674 pixelSize = redirect.rt.rt.renderTarget->pixelSize();
675 else if (redirect.rt.sw.paintDevice)
676 pixelSize = QSize(redirect.rt.sw.paintDevice->width(), redirect.rt.sw.paintDevice->height());
678 pixelSize = swapchain->currentPixelSize();
680 pixelSize = q->size() * devicePixelRatio;
682 renderer->setDevicePixelRatio(devicePixelRatio);
683 renderer->setDeviceRect(QRect(QPoint(0, 0), pixelSize));
684 renderer->setViewportRect(QRect(QPoint(0, 0), pixelSize));
686 QSGAbstractRenderer::MatrixTransformFlags matrixFlags;
687 bool flipY = rhi ? !rhi->isYUpInNDC() :
false;
688 if (!customRenderTarget.isNull() && customRenderTarget.mirrorVertically())
691 matrixFlags |= QSGAbstractRenderer::MatrixTransformFlipY;
693 const QRectF rect(QPointF(0, 0), pixelSize / devicePixelRatio);
694 renderer->setProjectionMatrixToRect(rect, matrixFlags, rhi && !rhi->isYUpInNDC());
696 context->renderNextFrame(renderer);
698 emit q->afterRendering();
699 runAndClearJobs(&afterRenderingJobs);
701 context->endNextFrame(renderer);
703 if (renderer && renderer->hasVisualizationModeWithContinuousUpdate()) {
707 QCoreApplication::postEvent(q,
new QEvent(QEvent::Type(FullUpdateRequest)));
782void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control)
789 contentItem =
new QQuickRootItem;
790 contentItem->setObjectName(q->objectName());
791 QQml_setParent_noEvent(contentItem, c);
792 QQmlEngine::setObjectOwnership(contentItem, QQmlEngine::CppOwnership);
793 QQuickItemPrivate *contentItemPrivate = QQuickItemPrivate::get(contentItem);
794 contentItemPrivate->window = q;
795 contentItemPrivate->windowRefCount = 1;
796 contentItemPrivate->flags |= QQuickItem::ItemIsFocusScope;
797 contentItem->setSize(q->size());
798 deliveryAgent =
new QQuickDeliveryAgent(contentItem);
800 visualizationMode = qgetenv(
"QSG_VISUALIZE");
801 renderControl = control;
803 QQuickRenderControlPrivate::get(renderControl)->window = q;
806 windowManager = QSGRenderLoop::instance();
808 Q_ASSERT(windowManager || renderControl);
810 QObject::connect(
static_cast<QGuiApplication *>(QGuiApplication::instance()),
811 &QGuiApplication::fontDatabaseChanged,
813 &QQuickWindow::handleFontDatabaseChanged);
816 lastReportedItemDevicePixelRatio = q->effectiveDevicePixelRatio();
821 QQuickRenderControlPrivate *renderControlPriv = QQuickRenderControlPrivate::get(renderControl);
822 sg = renderControlPriv->sg;
823 context = renderControlPriv->rc;
825 windowManager->addWindow(q);
826 sg = windowManager->sceneGraphContext();
827 context = windowManager->createRenderContext(sg);
830 q->setSurfaceType(windowManager ? windowManager->windowSurfaceType() : QSurface::OpenGLSurface);
831 q->setFormat(sg->defaultSurfaceFormat());
837 animationController.reset(
new QQuickAnimatorController(q));
840 QObject::connect(context, &QSGRenderContext::initialized, q, &QQuickWindow::sceneGraphInitialized, Qt::DirectConnection),
841 QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::sceneGraphInvalidated, Qt::DirectConnection),
842 QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::cleanupSceneGraph, Qt::DirectConnection),
844 QObject::connect(q, &QQuickWindow::focusObjectChanged, q, &QQuickWindow::activeFocusItemChanged),
845 QObject::connect(q, &QQuickWindow::screenChanged, q, &QQuickWindow::handleScreenChanged),
846 QObject::connect(qApp, &QGuiApplication::applicationStateChanged, q, &QQuickWindow::handleApplicationStateChanged),
847 QObject::connect(q, &QQuickWindow::frameSwapped, q, &QQuickWindow::runJobsAfterSwap, Qt::DirectConnection),
850 if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>())
851 service->addWindow(q);
1232QQuickWindow::~QQuickWindow()
1235 d->inDestructor =
true;
1236 if (d->renderControl) {
1237 QQuickRenderControlPrivate::get(d->renderControl)->windowDestroyed();
1238 }
else if (d->windowManager) {
1239 d->windowManager->removeWindow(
this);
1240 d->windowManager->windowDestroyed(
this);
1243 disconnect(
this, &QQuickWindow::focusObjectChanged,
this, &QQuickWindow::activeFocusItemChanged);
1244 disconnect(
this, &QQuickWindow::screenChanged,
this, &QQuickWindow::handleScreenChanged);
1245 disconnect(qApp, &QGuiApplication::applicationStateChanged,
this, &QQuickWindow::handleApplicationStateChanged);
1246 disconnect(
this, &QQuickWindow::frameSwapped,
this, &QQuickWindow::runJobsAfterSwap);
1248 delete d->incubationController; d->incubationController =
nullptr;
1249 QQuickRootItem *root = d->contentItem;
1250 d->contentItem =
nullptr;
1251 root->setParent(
nullptr);
1253 d->deliveryAgent =
nullptr;
1257 const std::lock_guard locker(d->renderJobMutex);
1258 qDeleteAll(std::exchange(d->beforeSynchronizingJobs, {}));
1259 qDeleteAll(std::exchange(d->afterSynchronizingJobs, {}));
1260 qDeleteAll(std::exchange(d->beforeRenderingJobs, {}));
1261 qDeleteAll(std::exchange(d->afterRenderingJobs, {}));;
1262 qDeleteAll(std::exchange(d->afterSwapJobs, {}));
1270 QQuickPixmap::purgeCache();
1272 for (QMetaObject::Connection &connection : d->connections)
1273 disconnect(connection);
1471bool QQuickWindow::event(QEvent *event)
1476 QQuickDeliveryAgent *da = d->deliveryAgent;
1477 if (event->isPointerEvent()) {
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488 if (d->windowEventDispatch)
1491 const bool wasAccepted = event->isAccepted();
1492 QScopedValueRollback windowEventDispatchGuard(d->windowEventDispatch,
true);
1493 qCDebug(lcPtr) <<
"dispatching to window functions in case of override" << event;
1494 QWindow::event(event);
1495 if (event->isAccepted() && !wasAccepted)
1499
1500
1501
1502
1503
1504
1505 auto pe =
static_cast<QPointerEvent *>(event);
1506 if (QQuickDeliveryAgentPrivate::isTouchEvent(pe))
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523 if (pe->pointCount()) {
1524 const bool synthMouse = QQuickDeliveryAgentPrivate::isSynthMouse(pe);
1525 if (QQuickDeliveryAgentPrivate::subsceneAgentsExist) {
1529 QFlatMap<QQuickDeliveryAgent*, QList<QEventPoint>> deliveryAgentsNeedingPoints;
1530 QEventPoint::States eventStates;
1532 auto insert = [&](QQuickDeliveryAgent *ptda,
const QEventPoint &pt) {
1533 if (pt.state() == QEventPoint::Pressed && !synthMouse)
1534 pe->clearPassiveGrabbers(pt);
1535 auto &ptList = deliveryAgentsNeedingPoints[ptda];
1536 auto idEquals = [](
auto id) {
return [id] (
const auto &e) {
return e.id() == id; }; };
1537 if (std::none_of(ptList.cbegin(), ptList.cend(), idEquals(pt.id())))
1541 for (
const auto &pt : pe->points()) {
1542 eventStates |= pt.state();
1543 auto epd = QPointingDevicePrivate::get(
const_cast<QPointingDevice*>(pe->pointingDevice()))->queryPointById(pt.id());
1545 bool foundAgent =
false;
1546 if (!epd->exclusiveGrabber.isNull() && !epd->exclusiveGrabberContext.isNull()) {
1547 if (
auto ptda = qobject_cast<QQuickDeliveryAgent *>(epd->exclusiveGrabberContext.data())) {
1549 qCDebug(lcPtr) << pe->type() <<
"point" << pt.id() << pt.state()
1550 <<
"@" << pt.scenePosition() <<
"will be re-delivered via known grabbing agent" << ptda <<
"to" << epd->exclusiveGrabber.data();
1554 for (
const auto &pgda : std::as_const(epd->passiveGrabbersContext)) {
1555 if (
auto ptda = qobject_cast<QQuickDeliveryAgent *>(pgda.data())) {
1557 qCDebug(lcPtr) << pe->type() <<
"point" << pt.id() << pt.state()
1558 <<
"@" << pt.scenePosition() <<
"will be re-delivered via known passive-grabbing agent" << ptda;
1566 for (
auto daAndPoints : deliveryAgentsNeedingPoints) {
1567 if (pe->pointCount() > 1) {
1568 Q_ASSERT(QQuickDeliveryAgentPrivate::isTouchEvent(pe));
1570 QEvent::Type eventType = pe->type();
1571 switch (eventStates) {
1572 case QEventPoint::State::Pressed:
1573 eventType = QEvent::TouchBegin;
1575 case QEventPoint::State::Released:
1576 eventType = QEvent::TouchEnd;
1579 eventType = QEvent::TouchUpdate;
1583 QMutableTouchEvent te(eventType, pe->pointingDevice(), pe->modifiers(), daAndPoints.second);
1584 te.setTimestamp(pe->timestamp());
1586 qCDebug(lcTouch) << daAndPoints.first <<
"shall now receive" << &te;
1587 ret = daAndPoints.first->event(&te) || ret;
1589 qCDebug(lcPtr) << daAndPoints.first <<
"shall now receive" << pe;
1590 ret = daAndPoints.first->event(pe) || ret;
1595 d->deliveryAgentPrivate()->clearGrabbers(pe);
1598 }
else if (!synthMouse) {
1601 for (
const auto &pt : pe->points()) {
1602 if (pt.state() == QEventPoint::Pressed)
1603 pe->clearPassiveGrabbers(pt);
1612 qCDebug(lcHoverTrace) <<
this <<
"some sort of event" << event;
1613 bool ret = (da && da->event(event));
1627 if (pe->isPointerEvent() && !QQuickDeliveryAgentPrivate::isTabletEvent(pe) && d->isPopup()
1628 && std::any_of(std::cbegin(pe->points()), std::cend(pe->points()), [pe](
auto &p){
return pe->exclusiveGrabber(p);}))
1631 d->deliveryAgentPrivate()->clearGrabbers(pe);
1633 if (pe->type() == QEvent::MouseButtonPress || pe->type() == QEvent::MouseButtonRelease) {
1636 d->maybeSynthesizeContextMenuEvent(
static_cast<QMouseEvent *>(pe));
1639#if QT_CONFIG(tabletevent)
1646 if (type() == Qt::Popup && QQuickDeliveryAgentPrivate::isTabletEvent(pe) &&
1647 !QRect(QPoint(), size()).contains(pe->points().first().scenePosition().toPoint())) {
1655 }
else if (event->isInputEvent()) {
1656 if (da && da->event(event))
1660 switch (event->type()) {
1662 case QEvent::FocusAboutToChange:
1665 case QEvent::InputMethod:
1666 case QEvent::InputMethodQuery:
1667#if QT_CONFIG(quick_draganddrop)
1668 case QEvent::DragEnter:
1669 case QEvent::DragLeave:
1670 case QEvent::DragMove:
1673 if (d->inDestructor)
1675 if (da && da->event(event))
1678 case QEvent::LanguageChange:
1679 case QEvent::LocaleChange:
1681 QCoreApplication::sendEvent(d->contentItem, event);
1683 case QEvent::UpdateRequest:
1684 if (d->windowManager)
1685 d->windowManager->handleUpdateRequest(
this);
1687 case QEvent::PlatformSurface:
1688 if ((
static_cast<QPlatformSurfaceEvent *>(event))->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed) {
1691 if (d->windowManager)
1692 d->windowManager->hide(
this);
1695 case QEvent::WindowDeactivate:
1696 if (
auto da = d->deliveryAgentPrivate())
1697 da->handleWindowDeactivate(
this);
1699 case QEvent::WindowActivate:
1701 QCoreApplication::sendEvent(d->contentItem, event);
1703 case QEvent::ApplicationPaletteChange:
1704 d->inheritPalette(QGuiApplication::palette());
1706 QCoreApplication::sendEvent(d->contentItem, event);
1708 case QEvent::DevicePixelRatioChange:
1709 physicalDpiChanged();
1711 case QEvent::SafeAreaMarginsChange:
1712 QQuickSafeArea::updateSafeAreasRecursively(d->contentItem);
1714 case QEvent::ChildWindowAdded: {
1715 auto *childEvent =
static_cast<QChildWindowEvent*>(event);
1716 auto *childWindow = childEvent->child();
1717 qCDebug(lcQuickWindow) <<
"Child window" << childWindow <<
"added to" <<
this;
1718 if (childWindow->handle()) {
1724 d->updateChildWindowStackingOrder();
1726 qCDebug(lcQuickWindow) <<
"No platform window yet."
1727 <<
"Deferring child window stacking until surface creation";
1735 if (event->type() == QEvent::Type(QQuickWindowPrivate::FullUpdateRequest))
1737 else if (event->type() == QEvent::Type(QQuickWindowPrivate::TriggerContextCreationFailure))
1738 d->windowManager->handleContextCreationFailure(
this);
1740 if (event->isPointerEvent())
1743 return QWindow::event(event);
2219void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item)
2221 QQuickItemPrivate *itemPriv = QQuickItemPrivate::get(item);
2222 quint32 dirty = itemPriv->dirtyAttributes;
2223 itemPriv->dirtyAttributes = 0;
2225 if ((dirty & QQuickItemPrivate::TransformUpdateMask) ||
2226 (dirty & QQuickItemPrivate::Size && itemPriv->origin() != QQuickItem::TopLeft &&
2227 (itemPriv->scale() != 1. || itemPriv->rotation() != 0.))) {
2231 if (itemPriv->x != 0. || itemPriv->y != 0.)
2232 matrix.translate(itemPriv->x, itemPriv->y);
2234 for (
int ii = itemPriv->transforms.size() - 1; ii >= 0; --ii)
2235 itemPriv->transforms.at(ii)->applyTo(&matrix);
2237 if (itemPriv->scale() != 1. || itemPriv->rotation() != 0.) {
2238 QPointF origin = item->transformOriginPoint();
2239 matrix.translate(origin.x(), origin.y());
2240 if (itemPriv->scale() != 1.)
2241 matrix.scale(itemPriv->scale(), itemPriv->scale());
2242 if (itemPriv->rotation() != 0.)
2243 matrix.rotate(itemPriv->rotation(), 0, 0, 1);
2244 matrix.translate(-origin.x(), -origin.y());
2247 itemPriv->itemNode()->setMatrix(matrix);
2250 const bool clipEffectivelyChanged = dirty & (QQuickItemPrivate::Clip | QQuickItemPrivate::Window);
2251 if (clipEffectivelyChanged) {
2252 QSGNode *parent = itemPriv->opacityNode() ? (QSGNode *)itemPriv->opacityNode()
2253 : (QSGNode *)itemPriv->itemNode();
2254 QSGNode *child = itemPriv->rootNode();
2256 if (
bool initializeClipNode = item->clip() && itemPriv->clipNode() ==
nullptr;
2257 initializeClipNode) {
2258 QQuickDefaultClipNode *clip =
new QQuickDefaultClipNode(item->clipRect());
2259 itemPriv->extra.value().clipNode = clip;
2263 parent->reparentChildNodesTo(clip);
2264 parent->appendChildNode(clip);
2266 parent->removeChildNode(child);
2267 clip->appendChildNode(child);
2268 parent->appendChildNode(clip);
2271 }
else if (
bool updateClipNode = item->clip() && itemPriv->clipNode() !=
nullptr;
2273 QQuickDefaultClipNode *clip = itemPriv->clipNode();
2274 clip->setClipRect(item->clipRect());
2276 }
else if (
bool removeClipNode = !item->clip() && itemPriv->clipNode() !=
nullptr;
2278 QQuickDefaultClipNode *clip = itemPriv->clipNode();
2279 parent->removeChildNode(clip);
2281 clip->removeChildNode(child);
2282 parent->appendChildNode(child);
2284 clip->reparentChildNodesTo(parent);
2287 delete itemPriv->clipNode();
2288 itemPriv->extra->clipNode =
nullptr;
2292 const int effectRefCount = itemPriv->extra.isAllocated() ? itemPriv->extra->effectRefCount : 0;
2293 const bool effectRefEffectivelyChanged =
2294 (dirty & (QQuickItemPrivate::EffectReference | QQuickItemPrivate::Window))
2295 && ((effectRefCount == 0) != (itemPriv->rootNode() ==
nullptr));
2296 if (effectRefEffectivelyChanged) {
2297 if (dirty & QQuickItemPrivate::ChildrenUpdateMask)
2298 itemPriv->childContainerNode()->removeAllChildNodes();
2300 QSGNode *parent = itemPriv->clipNode();
2302 parent = itemPriv->opacityNode();
2304 parent = itemPriv->itemNode();
2306 if (itemPriv->extra.isAllocated() && itemPriv->extra->effectRefCount) {
2307 Q_ASSERT(itemPriv->rootNode() ==
nullptr);
2308 QSGRootNode *root =
new QSGRootNode();
2309 itemPriv->extra->rootNode = root;
2310 parent->reparentChildNodesTo(root);
2311 parent->appendChildNode(root);
2313 Q_ASSERT(itemPriv->rootNode() !=
nullptr);
2314 QSGRootNode *root = itemPriv->rootNode();
2315 parent->removeChildNode(root);
2316 root->reparentChildNodesTo(parent);
2317 delete itemPriv->rootNode();
2318 itemPriv->extra->rootNode =
nullptr;
2322 if (dirty & QQuickItemPrivate::ChildrenUpdateMask) {
2324 bool fetchedPaintNode =
false;
2325 QList<QQuickItem *> orderedChildren = itemPriv->paintOrderChildItems();
2326 int desiredNodesSize = orderedChildren.size() + (itemPriv->paintNode ? 1 : 0);
2334 int desiredNodesProcessed = 0;
2339 QSGNode *groupNode = itemPriv->childContainerNode();
2340 QSGNode *currentNode = groupNode->firstChild();
2341 QSGNode *desiredNode =
nullptr;
2343 while (currentNode && (desiredNode = fetchNextNode(itemPriv, ii, fetchedPaintNode))) {
2344 if (currentNode != desiredNode) {
2347 if (currentNode->nextSibling() == desiredNode) {
2349 groupNode->removeChildNode(currentNode);
2354 if (desiredNode->parent()) {
2355 desiredNode->parent()->removeChildNode(desiredNode);
2357 groupNode->insertChildNodeBefore(desiredNode, currentNode);
2361 currentNode = desiredNode;
2364 currentNode = currentNode->nextSibling();
2365 desiredNodesProcessed++;
2371 if (desiredNodesProcessed < desiredNodesSize) {
2372 while ((desiredNode = fetchNextNode(itemPriv, ii, fetchedPaintNode))) {
2373 if (desiredNode->parent())
2374 desiredNode->parent()->removeChildNode(desiredNode);
2375 groupNode->appendChildNode(desiredNode);
2377 }
else if (currentNode) {
2381 while (currentNode) {
2382 QSGNode *node = currentNode->nextSibling();
2383 groupNode->removeChildNode(currentNode);
2389 if ((dirty & QQuickItemPrivate::Size) && itemPriv->clipNode()) {
2390 itemPriv->clipNode()->setRect(item->clipRect());
2391 itemPriv->clipNode()->update();
2394 if (dirty & (QQuickItemPrivate::OpacityValue | QQuickItemPrivate::Visible
2395 | QQuickItemPrivate::HideReference | QQuickItemPrivate::Window))
2397 qreal opacity = itemPriv->explicitVisible && (!itemPriv->extra.isAllocated() || itemPriv->extra->hideRefCount == 0)
2398 ? itemPriv->opacity() : qreal(0);
2400 if (opacity != 1 && !itemPriv->opacityNode()) {
2401 QSGOpacityNode *node =
new QSGOpacityNode;
2402 itemPriv->extra.value().opacityNode = node;
2404 QSGNode *parent = itemPriv->itemNode();
2405 QSGNode *child = itemPriv->clipNode();
2407 child = itemPriv->rootNode();
2410 parent->removeChildNode(child);
2411 node->appendChildNode(child);
2412 parent->appendChildNode(node);
2414 parent->reparentChildNodesTo(node);
2415 parent->appendChildNode(node);
2418 if (itemPriv->opacityNode())
2419 itemPriv->opacityNode()->setOpacity(opacity);
2422 if (dirty & QQuickItemPrivate::ContentUpdateMask) {
2424 if (itemPriv->flags & QQuickItem::ItemHasContents) {
2425 updatePaintNodeData.transformNode = itemPriv->itemNode();
2426 itemPriv->paintNode = item->updatePaintNode(itemPriv->paintNode, &updatePaintNodeData);
2428 Q_ASSERT(itemPriv->paintNode ==
nullptr ||
2429 itemPriv->paintNode->parent() ==
nullptr ||
2430 itemPriv->paintNode->parent() == itemPriv->childContainerNode());
2432 if (itemPriv->paintNode) {
2433 if (itemPriv->paintNode->parent() ==
nullptr) {
2434 QSGNode *before = qquickitem_before_paintNode(itemPriv);
2435 if (before && before->parent()) {
2436 Q_ASSERT(before->parent() == itemPriv->childContainerNode());
2437 itemPriv->childContainerNode()->insertChildNodeAfter(itemPriv->paintNode, before);
2439 itemPriv->childContainerNode()->prependChildNode(itemPriv->paintNode);
2446 if (itemPriv->extra.isAllocated() && itemPriv->extra->mutabilityGroupSet) {
2447 QSGNodePrivate::setMutabilityGroupOfSubtree(itemPriv->paintNode,
2448 itemPriv->extra->mutabilityGroup);
2452 }
else if (itemPriv->paintNode) {
2453 delete itemPriv->paintNode;
2454 itemPriv->paintNode =
nullptr;
2461 QList<QSGNode *> nodes;
2462 nodes << itemPriv->itemNodeInstance
2463 << itemPriv->opacityNode()
2464 << itemPriv->clipNode()
2465 << itemPriv->rootNode()
2466 << itemPriv->paintNode;
2467 nodes.removeAll(
nullptr);
2469 Q_ASSERT(nodes.constFirst() == itemPriv->itemNodeInstance);
2470 for (
int i=1; i<nodes.size(); ++i) {
2471 QSGNode *n = nodes.at(i);
2473 Q_ASSERT(n->parent() == nodes.at(i-1));
2475 Q_ASSERT(n == itemPriv->paintNode || n == itemPriv->childContainerNode() || n->childCount() == 1);