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

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