MCPcopy Create free account
hub / github.com/Snapchat/Valdi / flushOnDrawCallbacks

Method flushOnDrawCallbacks

valdi/src/valdi/runtime/Context/ViewNodeTree.cpp:641–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641void ViewNodeTree::flushOnDrawCallbacks() {
642 if (_onDrawCallbacks.empty()) {
643 return;
644 }
645
646 auto rootView = getRootView();
647 if (rootView == nullptr) {
648 return;
649 }
650
651 auto onDrawCallbacks = std::move(_onDrawCallbacks);
652 auto& transaction = getCurrentViewTransactionScope().transaction();
653 for (const auto& onDrawCallback : onDrawCallbacks) {
654 if (onDrawCallback == nullptr) {
655 continue;
656 }
657
658 transaction.scheduleOnNextDraw(
659 rootView, [onDrawCallback]() { (*onDrawCallback)({Value(TimePoint::now().getTime() * 1000.0)}); });
660 }
661}
662
663ViewNodesVisibilityObserver* ViewNodeTree::getViewNodesVisibilityObserver() const {
664 return _visibilityObserver.get();

Callers

nothing calls this directly

Calls 6

getRootViewFunction · 0.85
getTimeMethod · 0.80
ValueClass · 0.50
nowFunction · 0.50
emptyMethod · 0.45
scheduleOnNextDrawMethod · 0.45

Tested by

no test coverage detected