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

Function createRuntimeCacheEntry

tools/decoration-runtime.ts:2263–2370  ·  view source on GitHub ↗
(
  snapshot: WaylandWindowSnapshot,
  composition: WindowCompositionFunction,
  context: WindowCompositionContext = RENDER_COMPOSITION_CONTEXT,
)

Source from the content-addressed store, hash-verified

2261 forceFullReevaluation = false,
2262): {
2263 serialized?: unknown;
2264 treeUpdate: "full" | "patches" | "uniforms" | "none";
2265 uniformPatches?: NativeShaderUniformPatch[];
2266 transform: WindowTransform;
2267 managedWindow: ManagedWindowState;
2268 windowEffects: WindowEffectAssignment | null;
2269 dirtyNodeIds?: string[];
2270 managedWindowOnly?: boolean;
2271 nextPollInMs?: number;
2272} {
2273 let entry = cacheByWindowId.get(windowId);
2274 if (!entry) {
2275 if (!snapshot) {
2276 throw new Error(`missing cache entry for closing window ${windowId}`);
2277 }
2278 if (snapshot.id !== windowId) {
2279 throw new Error(
2280 `cached window snapshot id mismatch: ${windowId} != ${snapshot.id}`,
2281 );
2282 }
2283 debugHotReload("evaluate-cached-recreate-cache", {
2284 windowId,
2285 snapshot: snapshotForDebug(snapshot),
2286 });
2287 entry = createRuntimeCacheEntry(
2288 snapshot,
2289 composition,
2290 RENDER_COMPOSITION_CONTEXT,
2291 );
2292 cacheByWindowId.set(windowId, entry);
2293 openedWindowIds.add(windowId);
2294 dirtyWindowIds.delete(windowId);
2295 takeDirtyWindowNodeIds(windowId);
2296 takeDirtyWindowShaderUniformBindingKeys(windowId);
2297 takeManagedWindowOnlyDirty(windowId);
2298 events.emitFocus(entry.cache.window, snapshot.isFocused);
2299 if (!firstCommittedWindowIds.has(windowId)) {
2300 firstCommittedWindowIds.add(windowId);
2301 debugHotReload("evaluate-cached-recreate-first-commit", {
2302 windowId,
2303 snapshot: snapshotForDebug(snapshot),
2304 });
2305 events.emitFirstCommit(entry.cache.window);
2306 }
2307 }
2308
2309 let updated: ReturnType<CompositionEvaluationCache["update"]> = null;
2310 if (snapshot !== undefined) {
2311 if (snapshot.id !== windowId) {
2312 throw new Error(
2313 `cached window snapshot id mismatch: ${windowId} != ${snapshot.id}`,
2314 );
2315 }
2316 debugSSD("runtime-evaluate-cached-update-snapshot", {
2317 windowId,
2318 snapshot: snapshotForDebug(snapshot),
2319 });
2320 // Mirror the focus-diff handling of the other snapshot-update paths

Callers 4

evaluateCachedFunction · 0.85
evaluateSnapshotFunction · 0.85
evaluatePreconfigureFunction · 0.85
ensureRuntimeCacheEntryFunction · 0.85

Calls 4

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected