MCPcopy Create free account
hub / github.com/bea4dev/ShojiWM / collectRuntimeMutationState

Function collectRuntimeMutationState

tools/decoration-runtime.ts:2689–2784  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2687 if (
2688 allDirtyNodeIds.some(
2689 (candidate) =>
2690 candidate !== nodeId &&
2691 (candidate.startsWith(`${nodeId}.`) ||
2692 candidate.startsWith(`${nodeId}[`)),
2693 )
2694 ) {
2695 return null;
2696 }
2697 const previous = findSerializedNode(previousTree, nodeId);
2698 const next = findSerializedNode(nextTree, nodeId);
2699 const nodePatches = collectNodeShaderUniformPatches(previous, next);
2700 if (nodePatches === null) {
2701 return null;
2702 }
2703 patches.push(...nodePatches);
2704 }
2705 return patches;
2706}
2707
2708function collectNodeShaderUniformPatches(
2709 previousValue: unknown,
2710 nextValue: unknown,
2711): NativeShaderUniformPatch[] | null {
2712 const previous = asRecord(previousValue);
2713 const next = asRecord(nextValue);
2714 if (
2715 !previous ||
2716 !next ||
2717 previous.kind !== "ShaderEffect" ||
2718 next.kind !== "ShaderEffect" ||
2719 typeof previous.nodeId !== "string" ||
2720 previous.nodeId !== next.nodeId
2721 ) {
2722 return null;
2723 }
2724 const previousProps = asRecord(previous.props);
2725 const nextProps = asRecord(next.props);
2726 if (
2727 !previousProps ||
2728 !nextProps ||
2729 !recordsEqualExcept(previousProps, nextProps, "shader")
2730 ) {
2731 return null;
2732 }
2733 const previousShader = asRecord(previousProps.shader);
2734 const nextShader = asRecord(nextProps.shader);
2735 if (
2736 !previousShader ||
2737 !nextShader ||
2738 !recordsEqualExcept(previousShader, nextShader, "pipeline") ||
2739 !Array.isArray(previousShader.pipeline) ||
2740 !Array.isArray(nextShader.pipeline) ||
2741 previousShader.pipeline.length !== nextShader.pipeline.length
2742 ) {
2743 return null;
2744 }
2745
2746 const patches: NativeShaderUniformPatch[] = [];

Callers 10

processSchedulerTickFunction · 0.85
invokeGlobalKeyBindingFunction · 0.85
invokeWindowResizeFunction · 0.85
invokeWindowMoveFunction · 0.85
invokePointerMoveAsyncFunction · 0.85
invokeGestureSwipeAsyncFunction · 0.85

Calls 12

isManagedWindowOnlyDirtyFunction · 0.90
takeDirtyWindowNodeIdsFunction · 0.90
takeDirtyLayerNodeIdsFunction · 0.90
drainPendingActionsFunction · 0.85
debugHotReloadFunction · 0.85
clearMethod · 0.80
debugSSDFunction · 0.70
hasMethod · 0.65
fromMethod · 0.45

Tested by

no test coverage detected