( snapshot: WaylandWindowSnapshot, composition: WindowCompositionFunction, context: WindowCompositionContext = RENDER_COMPOSITION_CONTEXT, )
| 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 |
no test coverage detected