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

Method performUpdates

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

Source from the content-addressed store, hash-verified

251}
252
253void ViewNodeTree::performUpdates() {
254 // This does the following:
255 // - calculate the layout if needed
256 // - determine yoga node visibility
257 // - rerender every contexts which has one node that came
258 // on or off screen
259 // We keep doing that until we haven't found any more contexts to update.
260 // To avoid potential infinite recursion, we re-render a given context only once.
261
262 if (!_hasLayoutSpecs) {
263 return;
264 }
265
266 auto rootViewNode = getRootViewNode();
267 if (rootViewNode == nullptr) {
268 return;
269 }
270
271 if (_layoutDirty) {
272 _layoutDirty = false;
273 rootViewNode->performLayout(getCurrentViewTransactionScope(), _layoutSize, _layoutDirection);
274 }
275
276 flushOnLayoutCallbacks();
277
278 rootViewNode->updateVisibilityAndPerformUpdates(getCurrentViewTransactionScope());
279
280 flushOnDrawCallbacks();
281}
282
283Size ViewNodeTree::measureLayout(
284 float width, MeasureMode widthMode, float height, MeasureMode heightMode, LayoutDirection layoutDirection) {

Callers 3

setLayoutSpecsMethod · 0.95
TESTFunction · 0.45
runUpdatesInnerMethod · 0.45

Calls 2

performLayoutMethod · 0.65

Tested by 1

TESTFunction · 0.36