| 742 | } |
| 743 | |
| 744 | void ViewNodeTree::runUpdatesInner() { |
| 745 | const auto runUpdatesStart = std::chrono::steady_clock::now(); |
| 746 | if (!_runUpdatesInnerSessionStart.has_value()) { |
| 747 | _runUpdatesInnerSessionStart = runUpdatesStart; |
| 748 | } |
| 749 | |
| 750 | ContextEntry contextEntry(_context); |
| 751 | auto viewTransactionScope = beginViewTransaction(); |
| 752 | |
| 753 | auto layoutDirtyCounter = _layoutDirtyCounter; |
| 754 | _updating = true; |
| 755 | SmallVector<DispatchFunction, 4> completions; |
| 756 | |
| 757 | Ref<AssetsManager> assetsManager; |
| 758 | if (_runtime != nullptr) { |
| 759 | assetsManager = _runtime->getResourceManager().getAssetsManager(); |
| 760 | assetsManager->beginPauseUpdates(); |
| 761 | } |
| 762 | |
| 763 | #if !VALDI_DEBUG_TREE_UPDATES |
| 764 | VALDI_TRACE("Valdi.runTreeUpdates"); |
| 765 | #endif |
| 766 | |
| 767 | while (!_updateFunctions.empty()) { |
| 768 | auto updates = std::move(_updateFunctions.front()); |
| 769 | _updateFunctions.pop_front(); |
| 770 | |
| 771 | #if VALDI_DEBUG_TREE_UPDATES |
| 772 | // Emit trace per update with component name (symbol only) and trigger. |
| 773 | std::string traceSuffix; |
| 774 | if (!_context->getPath().isEmpty()) { |
| 775 | const auto& path = _context->getPath(); |
| 776 | traceSuffix = path.getSymbolName().isEmpty() ? path.toString() : path.getSymbolName().slowToString(); |
| 777 | } |
| 778 | if (!updates.traceTrigger.empty()) { |
| 779 | if (!traceSuffix.empty()) { |
| 780 | traceSuffix += "|"; |
| 781 | } |
| 782 | traceSuffix += updates.traceTrigger; |
| 783 | } |
| 784 | if (traceSuffix.empty()) { |
| 785 | traceSuffix = "unknown"; |
| 786 | } |
| 787 | VALDI_TRACE_META("Valdi.runTreeUpdates", traceSuffix); |
| 788 | #endif |
| 789 | |
| 790 | updates.performUpdates(); |
| 791 | if (updates.completion) { |
| 792 | completions.emplace_back(std::move(updates.completion)); |
| 793 | } |
| 794 | } |
| 795 | _updating = false; |
| 796 | |
| 797 | for (const auto& completion : completions) { |
| 798 | completion(); |
| 799 | } |
| 800 | |
| 801 | if (assetsManager != nullptr) { |
nothing calls this directly
no test coverage detected