@satinhq/kit 0.0.0-stage → 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +96 -0
- package/README.md +454 -2
- package/THIRD_PARTY_NOTICES.md +65 -0
- package/bin/satin.mjs +13 -0
- package/dist/acknowledgements/Acknowledgements.d.ts +4 -0
- package/dist/acknowledgements/Acknowledgements.js +42 -0
- package/dist/acknowledgements/bundledNotices.d.ts +4 -0
- package/dist/acknowledgements/bundledNotices.js +58 -0
- package/dist/acknowledgements/inventory.d.ts +17 -0
- package/dist/acknowledgements/inventory.js +10 -0
- package/dist/acknowledgements/inventory.json +39 -0
- package/dist/actions/ActionMenu.d.ts +30 -0
- package/dist/actions/ActionMenu.js +103 -0
- package/dist/actions/RowActions.d.ts +42 -0
- package/dist/actions/RowActions.js +820 -0
- package/dist/actions/contextMotion.d.ts +78 -0
- package/dist/actions/contextMotion.js +329 -0
- package/dist/actions/motion.d.ts +19 -0
- package/dist/actions/motion.js +74 -0
- package/dist/actions/nativeContextAppearance.json +86 -0
- package/dist/actions/nativeContextMotion.json +734 -0
- package/dist/actions/nativeMotion.json +388 -0
- package/dist/actions/preview.d.ts +27 -0
- package/dist/actions/preview.js +217 -0
- package/dist/actions/recognizers.d.ts +24 -0
- package/dist/actions/recognizers.js +87 -0
- package/dist/actions/rowScrub.d.ts +59 -0
- package/dist/actions/rowScrub.js +400 -0
- package/dist/actions/swipeSpring.d.ts +14 -0
- package/dist/actions/swipeSpring.js +35 -0
- package/dist/actions/types.d.ts +71 -0
- package/dist/actions/types.js +28 -0
- package/dist/app/InstallComponents.d.ts +16 -0
- package/dist/app/InstallComponents.js +104 -0
- package/dist/app/InstallationDiagnostics.d.ts +7 -0
- package/dist/app/InstallationDiagnostics.js +23 -0
- package/dist/app/OrientationGuard.d.ts +8 -0
- package/dist/app/OrientationGuard.js +9 -0
- package/dist/app/appearance.d.ts +18 -0
- package/dist/app/appearance.js +15 -0
- package/dist/app/appearanceStore.d.ts +30 -0
- package/dist/app/appearanceStore.js +228 -0
- package/dist/app/backgroundUpdate.d.ts +20 -0
- package/dist/app/backgroundUpdate.js +151 -0
- package/dist/app/buildInfo.d.ts +11 -0
- package/dist/app/buildInfo.js +12 -0
- package/dist/app/buildInfoBuild.d.ts +3 -0
- package/dist/app/buildInfoBuild.js +12 -0
- package/dist/app/checkCli.d.ts +1 -0
- package/dist/app/checkCli.js +73 -0
- package/dist/app/coldLaunchUpdate.d.ts +14 -0
- package/dist/app/coldLaunchUpdate.js +384 -0
- package/dist/app/definition.d.ts +85 -0
- package/dist/app/definition.js +347 -0
- package/dist/app/deployment.d.ts +28 -0
- package/dist/app/deployment.js +352 -0
- package/dist/app/deploymentBuild.d.ts +3 -0
- package/dist/app/deploymentBuild.js +55 -0
- package/dist/app/earlyWorker.d.ts +3 -0
- package/dist/app/earlyWorker.js +77 -0
- package/dist/app/head.d.ts +10 -0
- package/dist/app/head.js +120 -0
- package/dist/app/icons.d.ts +4 -0
- package/dist/app/icons.js +35 -0
- package/dist/app/install.d.ts +18 -0
- package/dist/app/install.js +82 -0
- package/dist/app/installCheck.d.ts +2 -0
- package/dist/app/installCheck.js +148 -0
- package/dist/app/installContext.d.ts +35 -0
- package/dist/app/installContext.js +45 -0
- package/dist/app/installCustom.d.ts +25 -0
- package/dist/app/installCustom.js +55 -0
- package/dist/app/installExperience.d.ts +22 -0
- package/dist/app/installExperience.js +389 -0
- package/dist/app/installExperienceDevice.d.ts +29 -0
- package/dist/app/installExperienceDevice.js +160 -0
- package/dist/app/installExperienceHome.d.ts +16 -0
- package/dist/app/installExperienceHome.js +304 -0
- package/dist/app/installExperienceRuntime.d.ts +37 -0
- package/dist/app/installExperienceRuntime.js +285 -0
- package/dist/app/installPolicy.d.ts +28 -0
- package/dist/app/installPolicy.js +90 -0
- package/dist/app/installQr.d.ts +10 -0
- package/dist/app/installQr.js +139 -0
- package/dist/app/installStrings.d.ts +52 -0
- package/dist/app/installStrings.js +75 -0
- package/dist/app/installTipPath.d.ts +12 -0
- package/dist/app/installTipPath.js +9 -0
- package/dist/app/installationFailure.d.ts +14 -0
- package/dist/app/installationFailure.js +38 -0
- package/dist/app/launch.d.ts +7 -0
- package/dist/app/launch.js +241 -0
- package/dist/app/launchReadiness.d.ts +9 -0
- package/dist/app/launchReadiness.js +72 -0
- package/dist/app/launchScreen.d.ts +16 -0
- package/dist/app/launchScreen.js +14 -0
- package/dist/app/launchScreenRuntime.d.ts +19 -0
- package/dist/app/launchScreenRuntime.js +313 -0
- package/dist/app/launchWatchdog.d.ts +1 -0
- package/dist/app/launchWatchdog.js +202 -0
- package/dist/app/manifests.d.ts +19 -0
- package/dist/app/manifests.js +20 -0
- package/dist/app/mdm.d.ts +3 -0
- package/dist/app/mdm.js +20 -0
- package/dist/app/mediaCheck.d.ts +9 -0
- package/dist/app/mediaCheck.js +122 -0
- package/dist/app/mediaTypes.d.ts +2 -0
- package/dist/app/mediaTypes.js +13 -0
- package/dist/app/platformPolicy.d.ts +3 -0
- package/dist/app/platformPolicy.js +10 -0
- package/dist/app/platformScripts.d.ts +6 -0
- package/dist/app/platformScripts.js +65 -0
- package/dist/app/releaseUpdates.d.ts +7 -0
- package/dist/app/releaseUpdates.js +53 -0
- package/dist/app/runtime.d.ts +9 -0
- package/dist/app/runtime.js +38 -0
- package/dist/app/startup.d.ts +30 -0
- package/dist/app/startup.js +24 -0
- package/dist/app/statusBand.d.ts +11 -0
- package/dist/app/statusBand.js +257 -0
- package/dist/app/viewport.d.ts +3 -0
- package/dist/app/viewport.js +42 -0
- package/dist/app/viewportValue.d.ts +5 -0
- package/dist/app/viewportValue.js +14 -0
- package/dist/app/vite.d.ts +27 -0
- package/dist/app/vite.js +440 -0
- package/dist/app/warmImage.d.ts +3 -0
- package/dist/app/warmImage.js +59 -0
- package/dist/content/content.d.ts +153 -0
- package/dist/content/content.js +315 -0
- package/dist/content/layout.d.ts +26 -0
- package/dist/content/layout.js +114 -0
- package/dist/content/scaledMetric.d.ts +3 -0
- package/dist/content/scaledMetric.js +68 -0
- package/dist/content/typography.d.ts +83 -0
- package/dist/content/typography.js +32 -0
- package/dist/controls/ActivityIndicatorSegments.d.ts +4 -0
- package/dist/controls/ActivityIndicatorSegments.js +5 -0
- package/dist/controls/ColorPicker.d.ts +20 -0
- package/dist/controls/ColorPicker.js +70 -0
- package/dist/controls/ControlRow.d.ts +5 -0
- package/dist/controls/ControlRow.js +10 -0
- package/dist/controls/DatePicker.d.ts +41 -0
- package/dist/controls/DatePicker.js +148 -0
- package/dist/controls/ProgressView.d.ts +17 -0
- package/dist/controls/ProgressView.js +24 -0
- package/dist/controls/civilDate.d.ts +49 -0
- package/dist/controls/civilDate.js +112 -0
- package/dist/data/database.d.ts +154 -0
- package/dist/data/database.js +710 -0
- package/dist/data/value-equal.d.ts +2 -0
- package/dist/data/value-equal.js +36 -0
- package/dist/data/write-store.d.ts +38 -0
- package/dist/data/write-store.js +192 -0
- package/dist/dev-menu/DevMenu.d.ts +1 -0
- package/dist/dev-menu/DevMenu.js +121 -0
- package/dist/dev-menu/actions.d.ts +12 -0
- package/dist/dev-menu/actions.js +99 -0
- package/dist/dev-menu/build.d.ts +5 -0
- package/dist/dev-menu/build.js +40 -0
- package/dist/dev-menu/gesture.d.ts +18 -0
- package/dist/dev-menu/gesture.js +109 -0
- package/dist/dev-menu/shake.d.ts +2 -0
- package/dist/dev-menu/shake.js +36 -0
- package/dist/dev-menu/types.d.ts +8 -0
- package/dist/dev-menu/types.js +1 -0
- package/dist/diagnostics.d.ts +3 -0
- package/dist/diagnostics.js +4 -0
- package/dist/docs/app-recipes.md +411 -0
- package/dist/docs/components/file-importer.md +54 -0
- package/dist/docs/components/paste-button.md +48 -0
- package/dist/docs/components/photos-picker.md +53 -0
- package/dist/docs/components/share-link.md +58 -0
- package/dist/docs/content.md +159 -0
- package/dist/docs/controls.md +151 -0
- package/dist/docs/data.md +332 -0
- package/dist/docs/limitations.md +40 -0
- package/dist/docs/messaging-scroll.md +234 -0
- package/dist/docs/networking.md +190 -0
- package/dist/docs/push.md +215 -0
- package/dist/docs/swiftui-reference.md +1895 -0
- package/dist/docs/symbols.md +293 -0
- package/dist/docs/tokens.md +60 -0
- package/dist/fidelity/devAssertions.d.ts +21 -0
- package/dist/fidelity/devAssertions.js +199 -0
- package/dist/focus/focusIntentMachine.d.ts +106 -0
- package/dist/focus/focusIntentMachine.js +359 -0
- package/dist/focus/navigationFocus.d.ts +42 -0
- package/dist/focus/navigationFocus.js +241 -0
- package/dist/focus/programmaticFocus.d.ts +15 -0
- package/dist/focus/programmaticFocus.js +152 -0
- package/dist/gestures/GestureView.d.ts +12 -0
- package/dist/gestures/GestureView.js +321 -0
- package/dist/gestures/arena.d.ts +138 -0
- package/dist/gestures/arena.js +417 -0
- package/dist/gestures/existingCompetitors.d.ts +79 -0
- package/dist/gestures/existingCompetitors.js +82 -0
- package/dist/gestures/gesture.d.ts +62 -0
- package/dist/gestures/gesture.js +107 -0
- package/dist/glass/ControlLens.d.ts +46 -0
- package/dist/glass/ControlLens.js +88 -0
- package/dist/glass/GlassBar.d.ts +9 -0
- package/dist/glass/GlassBar.js +22 -0
- package/dist/glass/GlassConfusionReview.d.ts +3 -0
- package/dist/glass/GlassConfusionReview.js +185 -0
- package/dist/glass/GlassEffect.d.ts +69 -0
- package/dist/glass/GlassEffect.js +550 -0
- package/dist/glass/GlassMaterialRoot.d.ts +7 -0
- package/dist/glass/GlassMaterialRoot.js +39 -0
- package/dist/glass/GlassPresentation.d.ts +28 -0
- package/dist/glass/GlassPresentation.js +1038 -0
- package/dist/glass/GlassProbeIcons.d.ts +8 -0
- package/dist/glass/GlassProbeIcons.js +12 -0
- package/dist/glass/GlassProbeOverlay.d.ts +52 -0
- package/dist/glass/GlassProbeOverlay.js +45 -0
- package/dist/glass/GlassTextField.d.ts +22 -0
- package/dist/glass/GlassTextField.js +12 -0
- package/dist/glass/MaterialEffectRoot.d.ts +9 -0
- package/dist/glass/MaterialEffectRoot.js +189 -0
- package/dist/glass/Menu.d.ts +3 -0
- package/dist/glass/Menu.js +35 -0
- package/dist/glass/MenuStack.d.ts +23 -0
- package/dist/glass/MenuStack.js +371 -0
- package/dist/glass/MenuSymbol.d.ts +7 -0
- package/dist/glass/MenuSymbol.js +16 -0
- package/dist/glass/MorphEllipsisArtwork.d.ts +2 -0
- package/dist/glass/MorphEllipsisArtwork.js +6 -0
- package/dist/glass/TabBar.d.ts +29 -0
- package/dist/glass/TabBar.js +169 -0
- package/dist/glass/capability.d.ts +25 -0
- package/dist/glass/capability.js +63 -0
- package/dist/glass/captureWindow.d.ts +60 -0
- package/dist/glass/captureWindow.js +119 -0
- package/dist/glass/confusionSession.d.ts +41 -0
- package/dist/glass/confusionSession.js +44 -0
- package/dist/glass/contactPhysics.d.ts +130 -0
- package/dist/glass/contactPhysics.js +214 -0
- package/dist/glass/context.d.ts +37 -0
- package/dist/glass/context.js +11 -0
- package/dist/glass/errorAlert.d.ts +6 -0
- package/dist/glass/errorAlert.js +57 -0
- package/dist/glass/errors.d.ts +22 -0
- package/dist/glass/errors.js +78 -0
- package/dist/glass/failurePolicy.d.ts +4 -0
- package/dist/glass/failurePolicy.js +20 -0
- package/dist/glass/fallback/material.d.ts +16 -0
- package/dist/glass/fallback/material.js +87 -0
- package/dist/glass/fallback/regions.d.ts +16 -0
- package/dist/glass/fallback/regions.js +249 -0
- package/dist/glass/fallback/runtime.d.ts +72 -0
- package/dist/glass/fallback/runtime.js +278 -0
- package/dist/glass/fallback/selection.d.ts +2 -0
- package/dist/glass/fallback/selection.js +9 -0
- package/dist/glass/fieldGeometry.d.ts +28 -0
- package/dist/glass/fieldGeometry.js +64 -0
- package/dist/glass/fieldMotion.d.ts +42 -0
- package/dist/glass/fieldMotion.js +47 -0
- package/dist/glass/glassContact.d.ts +76 -0
- package/dist/glass/glassContact.js +153 -0
- package/dist/glass/glassProbeSettings.d.ts +18 -0
- package/dist/glass/glassProbeSettings.js +133 -0
- package/dist/glass/lens/Scene.d.ts +108 -0
- package/dist/glass/lens/Scene.js +553 -0
- package/dist/glass/lens/backgrounds.json +103 -0
- package/dist/glass/lens/bitmapBackdrop.d.ts +14 -0
- package/dist/glass/lens/bitmapBackdrop.js +35 -0
- package/dist/glass/lens/controlLift.d.ts +94 -0
- package/dist/glass/lens/controlLift.js +78 -0
- package/dist/glass/lens/data.d.ts +19 -0
- package/dist/glass/lens/data.js +161 -0
- package/dist/glass/lens/drawableTop.d.ts +16 -0
- package/dist/glass/lens/drawableTop.js +15 -0
- package/dist/glass/lens/icons.d.ts +9 -0
- package/dist/glass/lens/icons.js +34 -0
- package/dist/glass/lens/interactiveContact.d.ts +33 -0
- package/dist/glass/lens/interactiveContact.js +158 -0
- package/dist/glass/lens/interactivePress.d.ts +95 -0
- package/dist/glass/lens/interactivePress.js +169 -0
- package/dist/glass/lens/ios27GlyphFit.json +126 -0
- package/dist/glass/lens/lensLightingSamples.json +1 -0
- package/dist/glass/lens/lensPress.d.ts +22 -0
- package/dist/glass/lens/lensPress.js +68 -0
- package/dist/glass/lens/lensPressSamples.json +1 -0
- package/dist/glass/lens/liquidMotion.d.ts +50 -0
- package/dist/glass/lens/liquidMotion.js +239 -0
- package/dist/glass/lens/materialGlassRecipes.json +776 -0
- package/dist/glass/lens/materialUniforms.d.ts +22 -0
- package/dist/glass/lens/materialUniforms.js +117 -0
- package/dist/glass/lens/menu-closing-close-fit.json +380 -0
- package/dist/glass/lens/menu-opening-native-fits.json +911 -0
- package/dist/glass/lens/menuContextFit.json +88 -0
- package/dist/glass/lens/menuContextOpacity.json +98 -0
- package/dist/glass/lens/menuContextPresentation.d.ts +15 -0
- package/dist/glass/lens/menuContextPresentation.js +65 -0
- package/dist/glass/lens/menuCornerFit.json +252 -0
- package/dist/glass/lens/menuCornerMotion.d.ts +9 -0
- package/dist/glass/lens/menuCornerMotion.js +5 -0
- package/dist/glass/lens/menuDropFit.json +64 -0
- package/dist/glass/lens/menuField.d.ts +178 -0
- package/dist/glass/lens/menuField.js +564 -0
- package/dist/glass/lens/menuGesturePresentation.d.ts +12 -0
- package/dist/glass/lens/menuGesturePresentation.js +42 -0
- package/dist/glass/lens/menuGlyphDropFit.json +38 -0
- package/dist/glass/lens/menuMorphFit.json +564 -0
- package/dist/glass/lens/menuMorphMotion.d.ts +70 -0
- package/dist/glass/lens/menuMorphMotion.js +219 -0
- package/dist/glass/lens/menuMorphPhoneFit.json +85 -0
- package/dist/glass/lens/menuMotion.d.ts +81 -0
- package/dist/glass/lens/menuMotion.js +323 -0
- package/dist/glass/lens/menuPlacement.d.ts +5 -0
- package/dist/glass/lens/menuPlacement.js +29 -0
- package/dist/glass/lens/menuSpring.d.ts +18 -0
- package/dist/glass/lens/menuSpring.js +29 -0
- package/dist/glass/lens/menuTouchLight.d.ts +13 -0
- package/dist/glass/lens/menuTouchLight.js +147 -0
- package/dist/glass/lens/mirrorConstants.d.ts +1 -0
- package/dist/glass/lens/mirrorConstants.js +2 -0
- package/dist/glass/lens/mirrorExtents.d.ts +52 -0
- package/dist/glass/lens/mirrorExtents.js +264 -0
- package/dist/glass/lens/mirrorInvalidation.d.ts +6 -0
- package/dist/glass/lens/mirrorInvalidation.js +10 -0
- package/dist/glass/lens/mirrorReuse.d.ts +20 -0
- package/dist/glass/lens/mirrorReuse.js +166 -0
- package/dist/glass/lens/motion.d.ts +62 -0
- package/dist/glass/lens/motion.js +93 -0
- package/dist/glass/lens/recordedMotion.d.ts +6 -0
- package/dist/glass/lens/recordedMotion.js +44 -0
- package/dist/glass/lens/referenceBackground.d.ts +9 -0
- package/dist/glass/lens/referenceBackground.js +151 -0
- package/dist/glass/lens/referenceProfiles.d.ts +21 -0
- package/dist/glass/lens/referenceProfiles.js +33 -0
- package/dist/glass/lens/referenceRegularTint.d.ts +12 -0
- package/dist/glass/lens/referenceRegularTint.js +41 -0
- package/dist/glass/lens/scopeSegments.d.ts +12 -0
- package/dist/glass/lens/scopeSegments.js +18 -0
- package/dist/glass/lens/scrollAnchoring.d.ts +15 -0
- package/dist/glass/lens/scrollAnchoring.js +17 -0
- package/dist/glass/lens/selectionParameters.json +94 -0
- package/dist/glass/lens/shapeParameters.json +198 -0
- package/dist/glass/lens/tab-motion-native-fits.json +778 -0
- package/dist/glass/lens/tabAccessoryMotion.d.ts +52 -0
- package/dist/glass/lens/tabAccessoryMotion.js +52 -0
- package/dist/glass/lens/tabChromaRimModel.d.ts +43 -0
- package/dist/glass/lens/tabChromaRimModel.js +93 -0
- package/dist/glass/lens/tabCollapseInkSamples.json +49 -0
- package/dist/glass/lens/tabCompactGesture.d.ts +15 -0
- package/dist/glass/lens/tabCompactGesture.js +50 -0
- package/dist/glass/lens/tabGeometryAttack.json +70 -0
- package/dist/glass/lens/tabGlyphColours.d.ts +17 -0
- package/dist/glass/lens/tabGlyphColours.js +37 -0
- package/dist/glass/lens/tabInterruptedDecaySamples.json +245 -0
- package/dist/glass/lens/tabInterruptedRestoreSamples.json +290 -0
- package/dist/glass/lens/tabMaterialModel.d.ts +10 -0
- package/dist/glass/lens/tabMaterialModel.js +108 -0
- package/dist/glass/lens/tabMinimizeInk.d.ts +15 -0
- package/dist/glass/lens/tabMinimizeInk.js +14 -0
- package/dist/glass/lens/tabMinimizeMotion.d.ts +36 -0
- package/dist/glass/lens/tabMinimizeMotion.js +107 -0
- package/dist/glass/lens/tabMinimizeSamples.json +411 -0
- package/dist/glass/lens/tabMotion.d.ts +91 -0
- package/dist/glass/lens/tabMotion.js +478 -0
- package/dist/glass/lens/tabMotionFit.d.ts +76 -0
- package/dist/glass/lens/tabMotionFit.js +61 -0
- package/dist/glass/lens/tabNativeSymbols.d.ts +1 -0
- package/dist/glass/lens/tabNativeSymbols.js +7 -0
- package/dist/glass/lens/tabPresentation.d.ts +21 -0
- package/dist/glass/lens/tabPresentation.js +20 -0
- package/dist/glass/lens/tabRelease.d.ts +5 -0
- package/dist/glass/lens/tabRelease.js +14 -0
- package/dist/glass/lens/tabRestoreMotion.d.ts +19 -0
- package/dist/glass/lens/tabRestoreMotion.js +65 -0
- package/dist/glass/lens/tabRestoreSamples.json +1272 -0
- package/dist/glass/lens/tabSearchMember.d.ts +38 -0
- package/dist/glass/lens/tabSearchMember.js +74 -0
- package/dist/glass/lens/tabSelectionMaterial.d.ts +20 -0
- package/dist/glass/lens/tabSelectionMaterial.js +23 -0
- package/dist/glass/lens/tabSelectionMeasurements.test-fixture.d.ts +9 -0
- package/dist/glass/lens/tabSelectionMeasurements.test-fixture.js +74 -0
- package/dist/glass/lens/tabSettingsSymbol.d.ts +1 -0
- package/dist/glass/lens/tabSettingsSymbol.js +2 -0
- package/dist/glass/lens/tabShapeResponse.d.ts +7 -0
- package/dist/glass/lens/tabShapeResponse.js +30 -0
- package/dist/glass/lens/theme.d.ts +18 -0
- package/dist/glass/lens/theme.js +40 -0
- package/dist/glass/lens/trace.d.ts +2 -0
- package/dist/glass/lens/trace.js +27 -0
- package/dist/glass/liquidContext.d.ts +31 -0
- package/dist/glass/liquidContext.js +2 -0
- package/dist/glass/menuPanelPlacement.d.ts +51 -0
- package/dist/glass/menuPanelPlacement.js +128 -0
- package/dist/glass/menuPresenter.d.ts +34 -0
- package/dist/glass/menuPresenter.js +983 -0
- package/dist/glass/menuSymbolMasks.d.ts +1 -0
- package/dist/glass/menuSymbolMasks.js +1 -0
- package/dist/glass/menuSymbolTokens.d.ts +22 -0
- package/dist/glass/menuSymbolTokens.js +12 -0
- package/dist/glass/menuTriggerGeometry.d.ts +99 -0
- package/dist/glass/menuTriggerGeometry.js +126 -0
- package/dist/glass/menuTriggerSnapshot.d.ts +77 -0
- package/dist/glass/menuTriggerSnapshot.js +69 -0
- package/dist/glass/menuTypes.d.ts +22 -0
- package/dist/glass/menuTypes.js +1 -0
- package/dist/glass/morphField.d.ts +18 -0
- package/dist/glass/morphField.js +139 -0
- package/dist/glass/presentationFrame.d.ts +43 -0
- package/dist/glass/presentationFrame.js +82 -0
- package/dist/glass/pressHighlight.d.ts +9 -0
- package/dist/glass/pressHighlight.js +158 -0
- package/dist/glass/regionRegistry.d.ts +93 -0
- package/dist/glass/regionRegistry.js +313 -0
- package/dist/glass/regions.d.ts +262 -0
- package/dist/glass/regions.js +147 -0
- package/dist/glass/regularMaterialContext.d.ts +45 -0
- package/dist/glass/regularMaterialContext.js +118 -0
- package/dist/glass/regularTriggerMaterial.d.ts +19 -0
- package/dist/glass/regularTriggerMaterial.js +111 -0
- package/dist/glass/regularTriggerRim.d.ts +163 -0
- package/dist/glass/regularTriggerRim.js +436 -0
- package/dist/glass/renderSpecs.d.ts +454 -0
- package/dist/glass/renderSpecs.js +231 -0
- package/dist/glass/rendererContract.d.ts +205 -0
- package/dist/glass/rendererContract.js +18 -0
- package/dist/glass/shapeTrack.d.ts +53 -0
- package/dist/glass/shapeTrack.js +74 -0
- package/dist/glass/shapeTrackRegistry.d.ts +40 -0
- package/dist/glass/shapeTrackRegistry.js +49 -0
- package/dist/glass/sourceDamage.d.ts +6 -0
- package/dist/glass/sourceDamage.js +8 -0
- package/dist/glass/submenuMotion.d.ts +205 -0
- package/dist/glass/submenuMotion.js +306 -0
- package/dist/glass/tabBarModel.d.ts +12 -0
- package/dist/glass/tabBarModel.js +32 -0
- package/dist/glass/testing.d.ts +14 -0
- package/dist/glass/testing.js +14 -0
- package/dist/glass/tokens.d.ts +79 -0
- package/dist/glass/tokens.js +86 -0
- package/dist/glass/toolbarMaterialContext.d.ts +28 -0
- package/dist/glass/toolbarMaterialContext.js +66 -0
- package/dist/glass/topLayer.d.ts +5 -0
- package/dist/glass/topLayer.js +10 -0
- package/dist/glass/unionOutline.d.ts +11 -0
- package/dist/glass/unionOutline.js +98 -0
- package/dist/glass/visibleDeadline.d.ts +21 -0
- package/dist/glass/visibleDeadline.js +61 -0
- package/dist/glass/webgpu/accessoryMorph.d.ts +99 -0
- package/dist/glass/webgpu/accessoryMorph.js +473 -0
- package/dist/glass/webgpu/accessoryTrack.d.ts +47 -0
- package/dist/glass/webgpu/accessoryTrack.js +59 -0
- package/dist/glass/webgpu/areaMips.d.ts +50 -0
- package/dist/glass/webgpu/areaMips.js +166 -0
- package/dist/glass/webgpu/backdrop.d.ts +86 -0
- package/dist/glass/webgpu/backdrop.js +243 -0
- package/dist/glass/webgpu/backdropLayers.d.ts +29 -0
- package/dist/glass/webgpu/backdropLayers.js +182 -0
- package/dist/glass/webgpu/backgroundLayers.d.ts +71 -0
- package/dist/glass/webgpu/backgroundLayers.js +385 -0
- package/dist/glass/webgpu/cadence.d.ts +18 -0
- package/dist/glass/webgpu/cadence.js +35 -0
- package/dist/glass/webgpu/canvasSubmission.d.ts +6 -0
- package/dist/glass/webgpu/canvasSubmission.js +22 -0
- package/dist/glass/webgpu/capture.d.ts +77 -0
- package/dist/glass/webgpu/capture.js +534 -0
- package/dist/glass/webgpu/captureBands.d.ts +39 -0
- package/dist/glass/webgpu/captureBands.js +53 -0
- package/dist/glass/webgpu/captureContext.d.ts +1 -0
- package/dist/glass/webgpu/captureContext.js +6 -0
- package/dist/glass/webgpu/captureDemand.d.ts +44 -0
- package/dist/glass/webgpu/captureDemand.js +81 -0
- package/dist/glass/webgpu/captureRelease.d.ts +18 -0
- package/dist/glass/webgpu/captureRelease.js +39 -0
- package/dist/glass/webgpu/client.d.ts +49 -0
- package/dist/glass/webgpu/client.js +336 -0
- package/dist/glass/webgpu/contextBackdrop.d.ts +6 -0
- package/dist/glass/webgpu/contextBackdrop.js +13 -0
- package/dist/glass/webgpu/contextComposite.d.ts +64 -0
- package/dist/glass/webgpu/contextComposite.js +66 -0
- package/dist/glass/webgpu/decodedImage.d.ts +1 -0
- package/dist/glass/webgpu/decodedImage.js +2 -0
- package/dist/glass/webgpu/deviceLimits.d.ts +5 -0
- package/dist/glass/webgpu/deviceLimits.js +8 -0
- package/dist/glass/webgpu/edgePass.d.ts +9 -0
- package/dist/glass/webgpu/edgePass.js +170 -0
- package/dist/glass/webgpu/entry.worker.d.ts +1 -0
- package/dist/glass/webgpu/entry.worker.js +28 -0
- package/dist/glass/webgpu/errorCode.d.ts +3 -0
- package/dist/glass/webgpu/errorCode.js +27 -0
- package/dist/glass/webgpu/errors.d.ts +8 -0
- package/dist/glass/webgpu/errors.js +55 -0
- package/dist/glass/webgpu/fieldInk.d.ts +9 -0
- package/dist/glass/webgpu/fieldInk.js +62 -0
- package/dist/glass/webgpu/foreground.d.ts +29 -0
- package/dist/glass/webgpu/foreground.js +313 -0
- package/dist/glass/webgpu/frameClock.d.ts +34 -0
- package/dist/glass/webgpu/frameClock.js +60 -0
- package/dist/glass/webgpu/frameGraph.d.ts +57 -0
- package/dist/glass/webgpu/frameGraph.js +287 -0
- package/dist/glass/webgpu/frameProbe.d.ts +58 -0
- package/dist/glass/webgpu/frameProbe.js +181 -0
- package/dist/glass/webgpu/interactionProfiles.d.ts +10 -0
- package/dist/glass/webgpu/interactionProfiles.js +25 -0
- package/dist/glass/webgpu/keptGlyphs.d.ts +68 -0
- package/dist/glass/webgpu/keptGlyphs.js +85 -0
- package/dist/glass/webgpu/keyboardBackdrop.d.ts +12 -0
- package/dist/glass/webgpu/keyboardBackdrop.js +51 -0
- package/dist/glass/webgpu/lagTrace.d.ts +31 -0
- package/dist/glass/webgpu/lagTrace.js +22 -0
- package/dist/glass/webgpu/layers.d.ts +100 -0
- package/dist/glass/webgpu/layers.js +301 -0
- package/dist/glass/webgpu/lensDebug.d.ts +4 -0
- package/dist/glass/webgpu/lensDebug.js +28 -0
- package/dist/glass/webgpu/lensDiffusion.d.ts +2 -0
- package/dist/glass/webgpu/lensDiffusion.js +20 -0
- package/dist/glass/webgpu/lensLightingFit.json +222 -0
- package/dist/glass/webgpu/menuLiftInput.d.ts +30 -0
- package/dist/glass/webgpu/menuLiftInput.js +39 -0
- package/dist/glass/webgpu/menuSurfaceGuard.d.ts +17 -0
- package/dist/glass/webgpu/menuSurfaceGuard.js +26 -0
- package/dist/glass/webgpu/minimize.d.ts +184 -0
- package/dist/glass/webgpu/minimize.js +470 -0
- package/dist/glass/webgpu/navigationAtlasCopy.d.ts +12 -0
- package/dist/glass/webgpu/navigationAtlasCopy.js +121 -0
- package/dist/glass/webgpu/navigationTracks.d.ts +3 -0
- package/dist/glass/webgpu/navigationTracks.js +84 -0
- package/dist/glass/webgpu/passes.d.ts +204 -0
- package/dist/glass/webgpu/passes.js +394 -0
- package/dist/glass/webgpu/pendingSurfaceInput.d.ts +29 -0
- package/dist/glass/webgpu/pendingSurfaceInput.js +51 -0
- package/dist/glass/webgpu/preparedSourcePixels.d.ts +21 -0
- package/dist/glass/webgpu/preparedSourcePixels.js +43 -0
- package/dist/glass/webgpu/presentationBackdrop.d.ts +3 -0
- package/dist/glass/webgpu/presentationBackdrop.js +33 -0
- package/dist/glass/webgpu/presentationDiffusion.d.ts +48 -0
- package/dist/glass/webgpu/presentationDiffusion.js +57 -0
- package/dist/glass/webgpu/presentationMaterial.d.ts +9 -0
- package/dist/glass/webgpu/presentationMaterial.js +156 -0
- package/dist/glass/webgpu/presenterViewport.d.ts +11 -0
- package/dist/glass/webgpu/presenterViewport.js +193 -0
- package/dist/glass/webgpu/production.d.ts +552 -0
- package/dist/glass/webgpu/production.js +1929 -0
- package/dist/glass/webgpu/productionInstalls.d.ts +53 -0
- package/dist/glass/webgpu/productionInstalls.js +225 -0
- package/dist/glass/webgpu/productionNavigation.d.ts +5 -0
- package/dist/glass/webgpu/productionNavigation.js +360 -0
- package/dist/glass/webgpu/productionPinnedTop.d.ts +80 -0
- package/dist/glass/webgpu/productionPinnedTop.js +77 -0
- package/dist/glass/webgpu/productionPinnedTopPrepare.d.ts +21 -0
- package/dist/glass/webgpu/productionPinnedTopPrepare.js +132 -0
- package/dist/glass/webgpu/productionPlanes.d.ts +135 -0
- package/dist/glass/webgpu/productionPlanes.js +412 -0
- package/dist/glass/webgpu/productionPrepare.d.ts +18 -0
- package/dist/glass/webgpu/productionPrepare.js +832 -0
- package/dist/glass/webgpu/productionTracks.d.ts +73 -0
- package/dist/glass/webgpu/productionTracks.js +22 -0
- package/dist/glass/webgpu/productionViewport.d.ts +20 -0
- package/dist/glass/webgpu/productionViewport.js +52 -0
- package/dist/glass/webgpu/profile.d.ts +37 -0
- package/dist/glass/webgpu/profile.js +101 -0
- package/dist/glass/webgpu/raster.d.ts +337 -0
- package/dist/glass/webgpu/raster.js +1360 -0
- package/dist/glass/webgpu/rasterMaterial.d.ts +19 -0
- package/dist/glass/webgpu/rasterMaterial.js +197 -0
- package/dist/glass/webgpu/rasterShaders.d.ts +7 -0
- package/dist/glass/webgpu/rasterShaders.js +105 -0
- package/dist/glass/webgpu/rasterUniforms.d.ts +304 -0
- package/dist/glass/webgpu/rasterUniforms.js +415 -0
- package/dist/glass/webgpu/regionBackdrop.d.ts +8 -0
- package/dist/glass/webgpu/regionBackdrop.js +12 -0
- package/dist/glass/webgpu/regionBridge.d.ts +145 -0
- package/dist/glass/webgpu/regionBridge.js +1691 -0
- package/dist/glass/webgpu/regionScene.d.ts +294 -0
- package/dist/glass/webgpu/regionScene.js +2144 -0
- package/dist/glass/webgpu/renderer.d.ts +8 -0
- package/dist/glass/webgpu/renderer.js +1478 -0
- package/dist/glass/webgpu/residentPlanes.d.ts +69 -0
- package/dist/glass/webgpu/residentPlanes.js +104 -0
- package/dist/glass/webgpu/restMaterial.d.ts +6 -0
- package/dist/glass/webgpu/restMaterial.js +65 -0
- package/dist/glass/webgpu/resumeOverlay.d.ts +44 -0
- package/dist/glass/webgpu/resumeOverlay.js +82 -0
- package/dist/glass/webgpu/sampleTrace.d.ts +11 -0
- package/dist/glass/webgpu/sampleTrace.js +50 -0
- package/dist/glass/webgpu/scrollEdgeBackdrop.d.ts +89 -0
- package/dist/glass/webgpu/scrollEdgeBackdrop.js +177 -0
- package/dist/glass/webgpu/scrollEdgePose.d.ts +4 -0
- package/dist/glass/webgpu/scrollEdgePose.js +49 -0
- package/dist/glass/webgpu/selectionThumb.d.ts +81 -0
- package/dist/glass/webgpu/selectionThumb.js +209 -0
- package/dist/glass/webgpu/shaders.d.ts +67 -0
- package/dist/glass/webgpu/shaders.js +595 -0
- package/dist/glass/webgpu/sharedLift.d.ts +7 -0
- package/dist/glass/webgpu/sharedLift.js +223 -0
- package/dist/glass/webgpu/sourcePixels.d.ts +42 -0
- package/dist/glass/webgpu/sourcePixels.js +140 -0
- package/dist/glass/webgpu/sourcePixels.worker.d.ts +1 -0
- package/dist/glass/webgpu/sourcePixels.worker.js +62 -0
- package/dist/glass/webgpu/tabGlyphInk.d.ts +14 -0
- package/dist/glass/webgpu/tabGlyphInk.js +72 -0
- package/dist/glass/webgpu/touchLight.d.ts +4 -0
- package/dist/glass/webgpu/touchLight.js +15 -0
- package/dist/glass/worker/client.d.ts +21 -0
- package/dist/glass/worker/client.js +152 -0
- package/dist/glass/worker/experiment.d.ts +13 -0
- package/dist/glass/worker/experiment.js +221 -0
- package/dist/glass/worker/fixture.d.ts +21 -0
- package/dist/glass/worker/fixture.js +152 -0
- package/dist/glass/worker/protocol.d.ts +439 -0
- package/dist/glass/worker/protocol.js +5 -0
- package/dist/graphicsProbe.d.ts +19 -0
- package/dist/graphicsProbe.js +111 -0
- package/dist/haptics/SensoryButton.d.ts +21 -0
- package/dist/haptics/SensoryButton.js +80 -0
- package/dist/image/ContentAdmission.d.ts +19 -0
- package/dist/image/ContentAdmission.js +70 -0
- package/dist/image/Image.d.ts +30 -0
- package/dist/image/Image.js +341 -0
- package/dist/image/asset.d.ts +9 -0
- package/dist/image/asset.js +1 -0
- package/dist/image/contentReadiness.d.ts +7 -0
- package/dist/image/contentReadiness.js +54 -0
- package/dist/image/imports.d.ts +4 -0
- package/dist/image/resource.d.ts +53 -0
- package/dist/image/resource.js +286 -0
- package/dist/image/vite.d.ts +3 -0
- package/dist/image/vite.js +63 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +102 -0
- package/dist/install.d.ts +8 -0
- package/dist/install.js +8 -0
- package/dist/internal.d.ts +96 -0
- package/dist/internal.js +80 -0
- package/dist/keyboard/adapter.d.ts +82 -0
- package/dist/keyboard/adapter.js +727 -0
- package/dist/keyboard/avoidance.d.ts +24 -0
- package/dist/keyboard/avoidance.js +283 -0
- package/dist/keyboard/caretMirror.d.ts +13 -0
- package/dist/keyboard/caretMirror.js +122 -0
- package/dist/keyboard/expectedKeyboard.d.ts +10 -0
- package/dist/keyboard/expectedKeyboard.js +60 -0
- package/dist/keyboard/geometry.d.ts +10 -0
- package/dist/keyboard/geometry.js +21 -0
- package/dist/keyboard/modalTapFocus.d.ts +41 -0
- package/dist/keyboard/modalTapFocus.js +224 -0
- package/dist/keyboard/motion.d.ts +54 -0
- package/dist/keyboard/motion.js +80 -0
- package/dist/keyboard/translation.d.ts +12 -0
- package/dist/keyboard/translation.js +19 -0
- package/dist/layout/adaptiveTabsContext.d.ts +5 -0
- package/dist/layout/adaptiveTabsContext.js +2 -0
- package/dist/layout/deviceIdiom.d.ts +4 -0
- package/dist/layout/deviceIdiom.js +12 -0
- package/dist/layout/layoutClass.d.ts +44 -0
- package/dist/layout/layoutClass.js +102 -0
- package/dist/layout/navigationLayoutContext.d.ts +8 -0
- package/dist/layout/navigationLayoutContext.js +5 -0
- package/dist/list-form/ListForm.d.ts +158 -0
- package/dist/list-form/ListForm.js +427 -0
- package/dist/list-form/ListItem.d.ts +30 -0
- package/dist/list-form/ListItem.js +251 -0
- package/dist/list-form/RowLabel.d.ts +14 -0
- package/dist/list-form/RowLabel.js +11 -0
- package/dist/list-form/Slider.d.ts +18 -0
- package/dist/list-form/Slider.js +235 -0
- package/dist/list-form/StepperButton.d.ts +9 -0
- package/dist/list-form/StepperButton.js +60 -0
- package/dist/list-form/Toggle.d.ts +16 -0
- package/dist/list-form/Toggle.js +204 -0
- package/dist/list-form/editMotion.d.ts +15 -0
- package/dist/list-form/editMotion.js +25 -0
- package/dist/list-form/editing.d.ts +102 -0
- package/dist/list-form/editing.js +51 -0
- package/dist/list-form/listContext.d.ts +4 -0
- package/dist/list-form/listContext.js +5 -0
- package/dist/list-form/offsets.d.ts +26 -0
- package/dist/list-form/offsets.js +34 -0
- package/dist/list-form/reorder.d.ts +20 -0
- package/dist/list-form/reorder.js +193 -0
- package/dist/list-form/rowMotion.d.ts +11 -0
- package/dist/list-form/rowMotion.js +236 -0
- package/dist/list-form/rowMotionScope.d.ts +14 -0
- package/dist/list-form/rowMotionScope.js +61 -0
- package/dist/list-form/separatorInsets.d.ts +4 -0
- package/dist/list-form/separatorInsets.js +87 -0
- package/dist/list-form/sliderContact.d.ts +40 -0
- package/dist/list-form/sliderContact.js +98 -0
- package/dist/list-form/state.d.ts +5 -0
- package/dist/list-form/state.js +8 -0
- package/dist/list-form/toggleContact.d.ts +55 -0
- package/dist/list-form/toggleContact.js +164 -0
- package/dist/media/controller.d.ts +7 -0
- package/dist/media/controller.js +612 -0
- package/dist/media/react.d.ts +9 -0
- package/dist/media/react.js +38 -0
- package/dist/media/systemMedia.d.ts +6 -0
- package/dist/media/systemMedia.js +200 -0
- package/dist/media/types.d.ts +83 -0
- package/dist/media/types.js +1 -0
- package/dist/menu/menuContact.d.ts +20 -0
- package/dist/menu/menuContact.js +286 -0
- package/dist/menu/menuGesture.d.ts +84 -0
- package/dist/menu/menuGesture.js +502 -0
- package/dist/menu/menuInteraction.d.ts +17 -0
- package/dist/menu/menuInteraction.js +34 -0
- package/dist/menu/menuOutside.d.ts +9 -0
- package/dist/menu/menuOutside.js +58 -0
- package/dist/menu/menuPanelContact.d.ts +11 -0
- package/dist/menu/menuPanelContact.js +77 -0
- package/dist/menu/menuTriggerHold.d.ts +3 -0
- package/dist/menu/menuTriggerHold.js +52 -0
- package/dist/menu/sampledMotion.d.ts +37 -0
- package/dist/menu/sampledMotion.js +86 -0
- package/dist/modal/lifecycle.d.ts +10 -0
- package/dist/modal/lifecycle.js +189 -0
- package/dist/motion/TransitionView.d.ts +12 -0
- package/dist/motion/TransitionView.js +118 -0
- package/dist/motion/animate.d.ts +20 -0
- package/dist/motion/animate.js +79 -0
- package/dist/motion/animationValue.d.ts +25 -0
- package/dist/motion/animationValue.js +42 -0
- package/dist/motion/composerMotion.d.ts +3 -0
- package/dist/motion/composerMotion.js +15 -0
- package/dist/motion/layoutTransaction.d.ts +7 -0
- package/dist/motion/layoutTransaction.js +28 -0
- package/dist/motion/matchedGeometry.d.ts +55 -0
- package/dist/motion/matchedGeometry.js +412 -0
- package/dist/motion/springPath.d.ts +27 -0
- package/dist/motion/springPath.js +46 -0
- package/dist/motion/springTrack.d.ts +33 -0
- package/dist/motion/springTrack.js +69 -0
- package/dist/motion/transition.d.ts +48 -0
- package/dist/motion/transition.js +56 -0
- package/dist/motion/transitionImages.d.ts +7 -0
- package/dist/motion/transitionImages.js +49 -0
- package/dist/motionProbe.d.ts +227 -0
- package/dist/motionProbe.js +697 -0
- package/dist/motionProbeControls.d.ts +2 -0
- package/dist/motionProbeControls.js +118 -0
- package/dist/motionProbeDelivery.d.ts +15 -0
- package/dist/motionProbeDelivery.js +84 -0
- package/dist/navigation/DetailList.d.ts +9 -0
- package/dist/navigation/DetailList.js +7 -0
- package/dist/navigation/NavigationChrome.d.ts +18 -0
- package/dist/navigation/NavigationChrome.js +195 -0
- package/dist/navigation/NavigationSearchRow.d.ts +9 -0
- package/dist/navigation/NavigationSearchRow.js +101 -0
- package/dist/navigation/NavigationTitleSlots.d.ts +18 -0
- package/dist/navigation/NavigationTitleSlots.js +64 -0
- package/dist/navigation/NavigatorHost.d.ts +17 -0
- package/dist/navigation/NavigatorHost.js +534 -0
- package/dist/navigation/ScreenContainer.d.ts +31 -0
- package/dist/navigation/ScreenContainer.js +219 -0
- package/dist/navigation/ScrubSourceFrames.d.ts +18 -0
- package/dist/navigation/ScrubSourceFrames.js +67 -0
- package/dist/navigation/Sidebar.d.ts +16 -0
- package/dist/navigation/Sidebar.js +20 -0
- package/dist/navigation/SidebarSymbol.d.ts +4 -0
- package/dist/navigation/SidebarSymbol.js +6 -0
- package/dist/navigation/ToolbarGlass.d.ts +2 -0
- package/dist/navigation/ToolbarGlass.js +429 -0
- package/dist/navigation/TransitionEdge.d.ts +4 -0
- package/dist/navigation/TransitionEdge.js +33 -0
- package/dist/navigation/bottomToolbarGeometry.d.ts +6 -0
- package/dist/navigation/bottomToolbarGeometry.js +14 -0
- package/dist/navigation/chromeCurves.d.ts +48 -0
- package/dist/navigation/chromeCurves.js +255 -0
- package/dist/navigation/glassTransition.d.ts +32 -0
- package/dist/navigation/glassTransition.js +55 -0
- package/dist/navigation/horizontalDrag.d.ts +6 -0
- package/dist/navigation/horizontalDrag.js +15 -0
- package/dist/navigation/interactivePop.d.ts +45 -0
- package/dist/navigation/interactivePop.js +86 -0
- package/dist/navigation/interactivePopTypes.d.ts +85 -0
- package/dist/navigation/interactivePopTypes.js +36 -0
- package/dist/navigation/keyboard.d.ts +9 -0
- package/dist/navigation/keyboard.js +55 -0
- package/dist/navigation/motion.d.ts +19 -0
- package/dist/navigation/motion.js +645 -0
- package/dist/navigation/motionTokens.d.ts +43 -0
- package/dist/navigation/motionTokens.js +75 -0
- package/dist/navigation/nativeScrubExperiment.d.ts +5 -0
- package/dist/navigation/nativeScrubExperiment.js +153 -0
- package/dist/navigation/nativeScrubSource.d.ts +15 -0
- package/dist/navigation/nativeScrubSource.js +88 -0
- package/dist/navigation/navigationChromeModel.d.ts +8 -0
- package/dist/navigation/navigationChromeModel.js +30 -0
- package/dist/navigation/navigationContext.d.ts +22 -0
- package/dist/navigation/navigationContext.js +65 -0
- package/dist/navigation/navigationEdge.d.ts +4 -0
- package/dist/navigation/navigationEdge.js +101 -0
- package/dist/navigation/pointerPop.d.ts +32 -0
- package/dist/navigation/pointerPop.js +206 -0
- package/dist/navigation/probeLayers.d.ts +7 -0
- package/dist/navigation/probeLayers.js +8 -0
- package/dist/navigation/registry.d.ts +14 -0
- package/dist/navigation/registry.js +31 -0
- package/dist/navigation/releaseDecision.d.ts +21 -0
- package/dist/navigation/releaseDecision.js +94 -0
- package/dist/navigation/releaseTrajectory.d.ts +20 -0
- package/dist/navigation/releaseTrajectory.js +95 -0
- package/dist/navigation/releaseVelocity.d.ts +9 -0
- package/dist/navigation/releaseVelocity.js +38 -0
- package/dist/navigation/routeCodec.d.ts +33 -0
- package/dist/navigation/routeCodec.js +123 -0
- package/dist/navigation/scrollEdge.d.ts +18 -0
- package/dist/navigation/scrollEdge.js +66 -0
- package/dist/navigation/scrubFrameLoop.d.ts +44 -0
- package/dist/navigation/scrubFrameLoop.js +129 -0
- package/dist/navigation/sidebarSelection.d.ts +5 -0
- package/dist/navigation/sidebarSelection.js +8 -0
- package/dist/navigation/splitContext.d.ts +17 -0
- package/dist/navigation/splitContext.js +9 -0
- package/dist/navigation/splitState.d.ts +46 -0
- package/dist/navigation/splitState.js +130 -0
- package/dist/navigation/stack.d.ts +25 -0
- package/dist/navigation/stack.js +136 -0
- package/dist/navigation/store.d.ts +80 -0
- package/dist/navigation/store.js +464 -0
- package/dist/navigation/toolbarGlassMotion.d.ts +40 -0
- package/dist/navigation/toolbarGlassMotion.js +202 -0
- package/dist/navigation/toolbarMinimization.d.ts +9 -0
- package/dist/navigation/toolbarMinimization.js +76 -0
- package/dist/navigation/toolbarMotionOwner.d.ts +6 -0
- package/dist/navigation/toolbarMotionOwner.js +30 -0
- package/dist/navigation/touchArbitration.d.ts +34 -0
- package/dist/navigation/touchArbitration.js +550 -0
- package/dist/navigation/tracking.d.ts +7 -0
- package/dist/navigation/tracking.js +19 -0
- package/dist/navigation/transitionBindings.d.ts +31 -0
- package/dist/navigation/transitionBindings.js +106 -0
- package/dist/navigation/transitionChrome.d.ts +31 -0
- package/dist/navigation/transitionChrome.js +380 -0
- package/dist/navigation/transitionPose.d.ts +52 -0
- package/dist/navigation/transitionPose.js +295 -0
- package/dist/navigation/types.d.ts +133 -0
- package/dist/navigation/types.js +1 -0
- package/dist/navigation/zoomDrag.d.ts +3 -0
- package/dist/navigation/zoomDrag.js +125 -0
- package/dist/navigation/zoomGeometry.d.ts +48 -0
- package/dist/navigation/zoomGeometry.js +94 -0
- package/dist/navigation/zoomGlass.d.ts +27 -0
- package/dist/navigation/zoomGlass.js +64 -0
- package/dist/navigation/zoomMotion.d.ts +73 -0
- package/dist/navigation/zoomMotion.js +104 -0
- package/dist/navigation/zoomTransition.d.ts +82 -0
- package/dist/navigation/zoomTransition.js +975 -0
- package/dist/presentation/Presentation.d.ts +61 -0
- package/dist/presentation/Presentation.js +92 -0
- package/dist/presentation/PresentationSurface.d.ts +29 -0
- package/dist/presentation/PresentationSurface.js +586 -0
- package/dist/presentation/PresentedSheet.d.ts +2 -0
- package/dist/presentation/PresentedSheet.js +571 -0
- package/dist/presentation/activity.d.ts +3 -0
- package/dist/presentation/activity.js +24 -0
- package/dist/presentation/coldLaunch.d.ts +2 -0
- package/dist/presentation/coldLaunch.js +19 -0
- package/dist/presentation/dismiss.d.ts +26 -0
- package/dist/presentation/dismiss.js +30 -0
- package/dist/presentation/glassMotion.d.ts +39 -0
- package/dist/presentation/glassMotion.js +259 -0
- package/dist/presentation/glassReady.d.ts +11 -0
- package/dist/presentation/glassReady.js +246 -0
- package/dist/presentation/model.d.ts +108 -0
- package/dist/presentation/model.js +183 -0
- package/dist/presentation/motion.d.ts +56 -0
- package/dist/presentation/motion.js +263 -0
- package/dist/presentation/presentationMotion.d.ts +10 -0
- package/dist/presentation/presentationMotion.js +74 -0
- package/dist/presentation/presentationSource.d.ts +2 -0
- package/dist/presentation/presentationSource.js +28 -0
- package/dist/presentation/sheetChromeContext.d.ts +2 -0
- package/dist/presentation/sheetChromeContext.js +3 -0
- package/dist/presentation/sheetMaterialTransition.d.ts +14 -0
- package/dist/presentation/sheetMaterialTransition.js +33 -0
- package/dist/presentation/sheetReleaseMotion.d.ts +18 -0
- package/dist/presentation/sheetReleaseMotion.js +123 -0
- package/dist/presentation/useAlertKeyboardMotion.d.ts +8 -0
- package/dist/presentation/useAlertKeyboardMotion.js +104 -0
- package/dist/press/Pressable.d.ts +19 -0
- package/dist/press/Pressable.js +16 -0
- package/dist/press/activation.d.ts +20 -0
- package/dist/press/activation.js +28 -0
- package/dist/press/contactReceipt.d.ts +23 -0
- package/dist/press/contactReceipt.js +177 -0
- package/dist/press/gestureArbitration.d.ts +13 -0
- package/dist/press/gestureArbitration.js +38 -0
- package/dist/press/stateMachine.d.ts +29 -0
- package/dist/press/stateMachine.js +39 -0
- package/dist/press/tokens.d.ts +18 -0
- package/dist/press/tokens.js +19 -0
- package/dist/press/usePressInteraction.d.ts +30 -0
- package/dist/press/usePressInteraction.js +247 -0
- package/dist/public/Label.d.ts +16 -0
- package/dist/public/Label.js +40 -0
- package/dist/public/NativeFilePicker.d.ts +19 -0
- package/dist/public/NativeFilePicker.js +75 -0
- package/dist/public/Screen.d.ts +42 -0
- package/dist/public/Screen.js +87 -0
- package/dist/public/actions.d.ts +16 -0
- package/dist/public/actions.js +15 -0
- package/dist/public/buttonBorderShape.d.ts +7 -0
- package/dist/public/buttonBorderShape.js +9 -0
- package/dist/public/chrome.d.ts +3 -0
- package/dist/public/chrome.js +5 -0
- package/dist/public/colors.d.ts +29 -0
- package/dist/public/colors.js +28 -0
- package/dist/public/context.d.ts +19 -0
- package/dist/public/context.js +8 -0
- package/dist/public/controlStyle.d.ts +93 -0
- package/dist/public/controlStyle.js +52 -0
- package/dist/public/controls.d.ts +360 -0
- package/dist/public/controls.js +301 -0
- package/dist/public/definition.d.ts +65 -0
- package/dist/public/definition.js +58 -0
- package/dist/public/deviceActions.d.ts +23 -0
- package/dist/public/deviceActions.js +87 -0
- package/dist/public/environment.d.ts +77 -0
- package/dist/public/environment.js +171 -0
- package/dist/public/fieldContext.d.ts +2 -0
- package/dist/public/fieldContext.js +3 -0
- package/dist/public/filePickers.d.ts +25 -0
- package/dist/public/filePickers.js +11 -0
- package/dist/public/glass.d.ts +31 -0
- package/dist/public/glass.js +29 -0
- package/dist/public/glassValue.d.ts +19 -0
- package/dist/public/glassValue.js +32 -0
- package/dist/public/keyboard.d.ts +4 -0
- package/dist/public/keyboard.js +6 -0
- package/dist/public/navigationTransition.d.ts +48 -0
- package/dist/public/navigationTransition.js +49 -0
- package/dist/public/pickerNavigation.d.ts +7 -0
- package/dist/public/pickerNavigation.js +64 -0
- package/dist/public/presentation.d.ts +40 -0
- package/dist/public/presentation.js +21 -0
- package/dist/public/presentationContext.d.ts +2 -0
- package/dist/public/presentationContext.js +3 -0
- package/dist/public/routeRegistry.d.ts +3 -0
- package/dist/public/routeRegistry.js +10 -0
- package/dist/public/routes.d.ts +74 -0
- package/dist/public/routes.js +105 -0
- package/dist/public/runtime.d.ts +134 -0
- package/dist/public/runtime.js +292 -0
- package/dist/public/screenChrome.d.ts +91 -0
- package/dist/public/screenChrome.js +187 -0
- package/dist/public/scroll.d.ts +38 -0
- package/dist/public/scroll.js +7 -0
- package/dist/public/storage.d.ts +9 -0
- package/dist/public/storage.js +9 -0
- package/dist/public/structure.d.ts +65 -0
- package/dist/public/structure.js +40 -0
- package/dist/public/toolbar.d.ts +37 -0
- package/dist/public/toolbar.js +76 -0
- package/dist/push/PushPermissionExplainer.d.ts +14 -0
- package/dist/push/PushPermissionExplainer.js +30 -0
- package/dist/push/notifications.d.ts +54 -0
- package/dist/push/notifications.js +276 -0
- package/dist/push/routes.d.ts +20 -0
- package/dist/push/routes.js +63 -0
- package/dist/push/schema.d.ts +42 -0
- package/dist/push/schema.js +41 -0
- package/dist/push/urlProjection.d.ts +24 -0
- package/dist/push/urlProjection.js +207 -0
- package/dist/reachability/controller.d.ts +21 -0
- package/dist/reachability/controller.js +202 -0
- package/dist/reachability/model.d.ts +94 -0
- package/dist/reachability/model.js +131 -0
- package/dist/reachability/react.d.ts +29 -0
- package/dist/reachability/react.js +69 -0
- package/dist/restoration/navigation.d.ts +9 -0
- package/dist/restoration/navigation.js +55 -0
- package/dist/restoration/react.d.ts +6 -0
- package/dist/restoration/react.js +21 -0
- package/dist/restoration/routes.d.ts +22 -0
- package/dist/restoration/routes.js +166 -0
- package/dist/restoration/scene.d.ts +44 -0
- package/dist/restoration/scene.js +284 -0
- package/dist/root/SatinRoot.d.ts +25 -0
- package/dist/root/SatinRoot.js +512 -0
- package/dist/root/mountSatin.d.ts +12 -0
- package/dist/root/mountSatin.js +60 -0
- package/dist/root/runtimeContext.d.ts +26 -0
- package/dist/root/runtimeContext.js +30 -0
- package/dist/safe-area/Overlay.d.ts +9 -0
- package/dist/safe-area/Overlay.js +26 -0
- package/dist/safe-area/SafeAreaInset.d.ts +25 -0
- package/dist/safe-area/SafeAreaInset.js +138 -0
- package/dist/safe-area/bottomInsetGeometry.d.ts +12 -0
- package/dist/safe-area/bottomInsetGeometry.js +73 -0
- package/dist/safe-area/context.d.ts +15 -0
- package/dist/safe-area/context.js +8 -0
- package/dist/safe-area/displayCorners.d.ts +21 -0
- package/dist/safe-area/displayCorners.js +70 -0
- package/dist/safe-area/keyboardCarrier.d.ts +26 -0
- package/dist/safe-area/keyboardCarrier.js +394 -0
- package/dist/safe-area/keyboardCarrierGeometry.d.ts +37 -0
- package/dist/safe-area/keyboardCarrierGeometry.js +49 -0
- package/dist/safe-area/modifiers.d.ts +52 -0
- package/dist/safe-area/modifiers.js +86 -0
- package/dist/safe-area/useSafeAreaMetrics.d.ts +83 -0
- package/dist/safe-area/useSafeAreaMetrics.js +367 -0
- package/dist/safe-area/windowChrome.d.ts +7 -0
- package/dist/safe-area/windowChrome.js +14 -0
- package/dist/scroll/RefreshControl.d.ts +8 -0
- package/dist/scroll/RefreshControl.js +135 -0
- package/dist/scroll/ScrollSurface.d.ts +62 -0
- package/dist/scroll/ScrollSurface.js +278 -0
- package/dist/scroll/ScrollTarget.d.ts +6 -0
- package/dist/scroll/ScrollTarget.js +11 -0
- package/dist/scroll/edgePolicy.d.ts +21 -0
- package/dist/scroll/edgePolicy.js +17 -0
- package/dist/scroll/insertionMotion.d.ts +15 -0
- package/dist/scroll/insertionMotion.js +128 -0
- package/dist/scroll/nativeScroll.d.ts +14 -0
- package/dist/scroll/nativeScroll.js +71 -0
- package/dist/scroll/position.d.ts +31 -0
- package/dist/scroll/position.js +273 -0
- package/dist/scroll/pressOwnership.d.ts +4 -0
- package/dist/scroll/pressOwnership.js +65 -0
- package/dist/scroll/refreshMotion.d.ts +9 -0
- package/dist/scroll/refreshMotion.js +15 -0
- package/dist/scroll/refreshable.d.ts +6 -0
- package/dist/scroll/refreshable.js +50 -0
- package/dist/scroll/registry.d.ts +38 -0
- package/dist/scroll/registry.js +261 -0
- package/dist/scroll/screenGeometry.d.ts +8 -0
- package/dist/scroll/screenGeometry.js +50 -0
- package/dist/scroll/scrollIndicator.d.ts +7 -0
- package/dist/scroll/scrollIndicator.js +114 -0
- package/dist/scroll/scrollJump.d.ts +7 -0
- package/dist/scroll/scrollJump.js +16 -0
- package/dist/scroll/types.d.ts +12 -0
- package/dist/scroll/types.js +1 -0
- package/dist/search/SearchDrawer.d.ts +16 -0
- package/dist/search/SearchDrawer.js +421 -0
- package/dist/search/SearchScopesBar.d.ts +6 -0
- package/dist/search/SearchScopesBar.js +12 -0
- package/dist/search/SearchToolbarField.d.ts +8 -0
- package/dist/search/SearchToolbarField.js +115 -0
- package/dist/search/searchBackdrop.d.ts +12 -0
- package/dist/search/searchBackdrop.js +45 -0
- package/dist/search/searchChrome.d.ts +13 -0
- package/dist/search/searchChrome.js +31 -0
- package/dist/search/searchMotion.d.ts +30 -0
- package/dist/search/searchMotion.js +46 -0
- package/dist/search/searchPlacement.d.ts +11 -0
- package/dist/search/searchPlacement.js +15 -0
- package/dist/search/searchable.d.ts +46 -0
- package/dist/search/searchable.js +5 -0
- package/dist/search/useSearchPresentation.d.ts +15 -0
- package/dist/search/useSearchPresentation.js +61 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +144 -0
- package/dist/settings/DisclosureIndicator.d.ts +4 -0
- package/dist/settings/DisclosureIndicator.js +6 -0
- package/dist/settings/tokens.d.ts +129 -0
- package/dist/settings/tokens.js +143 -0
- package/dist/shapes/corners.d.ts +14 -0
- package/dist/shapes/corners.js +80 -0
- package/dist/styles.css +9078 -0
- package/dist/styles.css.d.ts +3 -0
- package/dist/sw/activationState.d.ts +20 -0
- package/dist/sw/activationState.js +39 -0
- package/dist/sw/generator.d.ts +14 -0
- package/dist/sw/generator.js +26 -0
- package/dist/sw/manifest.d.ts +32 -0
- package/dist/sw/manifest.js +137 -0
- package/dist/sw/protocol.d.ts +7 -0
- package/dist/sw/protocol.js +7 -0
- package/dist/sw/pushRuntime.d.ts +2 -0
- package/dist/sw/pushRuntime.js +161 -0
- package/dist/sw/registerAppShell.d.ts +25 -0
- package/dist/sw/registerAppShell.js +259 -0
- package/dist/sw/renderServiceWorker.d.ts +10 -0
- package/dist/sw/renderServiceWorker.js +370 -0
- package/dist/sw/requestRouting.d.ts +13 -0
- package/dist/sw/requestRouting.js +26 -0
- package/dist/sw/updateCheck.d.ts +2 -0
- package/dist/sw/updateCheck.js +25 -0
- package/dist/sw/vite.d.ts +20 -0
- package/dist/sw/vite.js +71 -0
- package/dist/symbols/Symbol.d.ts +33 -0
- package/dist/symbols/Symbol.js +59 -0
- package/dist/symbols/catalogue.d.ts +4 -0
- package/dist/symbols/catalogue.js +4139 -0
- package/dist/symbols/exclusions.d.ts +2 -0
- package/dist/symbols/exclusions.js +4 -0
- package/dist/symbols/inheritedWeight.d.ts +3 -0
- package/dist/symbols/inheritedWeight.js +104 -0
- package/dist/symbols/metrics.d.ts +38 -0
- package/dist/symbols/metrics.js +53 -0
- package/dist/symbols/svg.d.ts +3 -0
- package/dist/symbols/svg.js +16 -0
- package/dist/symbols/types.d.ts +30 -0
- package/dist/symbols/types.js +1 -0
- package/dist/tabs/TabSection.d.ts +12 -0
- package/dist/tabs/TabSection.js +4 -0
- package/dist/tabs/TabSidebarSurface.d.ts +7 -0
- package/dist/tabs/TabSidebarSurface.js +29 -0
- package/dist/tabs/TabView.d.ts +28 -0
- package/dist/tabs/TabView.js +258 -0
- package/dist/tabs/accessoryContact.d.ts +2 -0
- package/dist/tabs/accessoryContact.js +42 -0
- package/dist/tabs/compactBar.d.ts +4 -0
- package/dist/tabs/compactBar.js +28 -0
- package/dist/tabs/context.d.ts +8 -0
- package/dist/tabs/context.js +6 -0
- package/dist/tabs/keyboard.d.ts +3 -0
- package/dist/tabs/keyboard.js +23 -0
- package/dist/tabs/model.d.ts +6 -0
- package/dist/tabs/model.js +16 -0
- package/dist/tabs/presentation.d.ts +7 -0
- package/dist/tabs/presentation.js +14 -0
- package/dist/tabs/sourceRevision.d.ts +3 -0
- package/dist/tabs/sourceRevision.js +36 -0
- package/dist/tabs/tabSidebarGlyph.d.ts +2 -0
- package/dist/tabs/tabSidebarGlyph.js +11 -0
- package/dist/tasks/useTask.d.ts +16 -0
- package/dist/tasks/useTask.js +67 -0
- package/dist/testing.d.ts +9 -0
- package/dist/testing.js +11 -0
- package/dist/text-input/TextEditor.d.ts +25 -0
- package/dist/text-input/TextEditor.js +74 -0
- package/dist/text-input/TextField.d.ts +32 -0
- package/dist/text-input/TextField.js +29 -0
- package/dist/text-input/editorGeometry.d.ts +2 -0
- package/dist/text-input/editorGeometry.js +6 -0
- package/dist/text-input/editorTextLayout.d.ts +2 -0
- package/dist/text-input/editorTextLayout.js +31 -0
- package/dist/text-input/focusChain.d.ts +27 -0
- package/dist/text-input/focusChain.js +62 -0
- package/dist/text-input/kinds.d.ts +8 -0
- package/dist/text-input/kinds.js +34 -0
- package/dist/text-input/measureEditor.d.ts +2 -0
- package/dist/text-input/measureEditor.js +50 -0
- package/dist/text-input/submit.d.ts +9 -0
- package/dist/text-input/submit.js +7 -0
- package/dist/unstable.d.ts +16 -0
- package/dist/unstable.js +16 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +3 -0
- package/dist/web/WebView.d.ts +42 -0
- package/dist/web/WebView.js +115 -0
- package/dist/web/authentication.d.ts +75 -0
- package/dist/web/authentication.js +488 -0
- package/dist/web/openURL.d.ts +37 -0
- package/dist/web/openURL.js +89 -0
- package/dist/web/urlPolicy.d.ts +3 -0
- package/dist/web/urlPolicy.js +19 -0
- package/dist/web/useWebAuthentication.d.ts +3 -0
- package/dist/web/useWebAuthentication.js +6 -0
- package/dist/zoom/Zoomable.d.ts +10 -0
- package/dist/zoom/Zoomable.js +116 -0
- package/dist/zoom/geometry.d.ts +11 -0
- package/dist/zoom/geometry.js +16 -0
- package/package.json +115 -3
|
@@ -0,0 +1,1478 @@
|
|
|
1
|
+
import { submitCanvasCommands } from './canvasSubmission.js';
|
|
2
|
+
import { gpuScope } from './errors.js';
|
|
3
|
+
import { retainNavigationAtlas } from './navigationAtlasCopy.js';
|
|
4
|
+
import { FrameProbe } from './frameProbe.js';
|
|
5
|
+
import { lagMark, lagMarks, lagTraceEnabled, lagTraceHasRoom, setLagTrace, } from './lagTrace.js';
|
|
6
|
+
import { prewarmKernels } from './passes.js';
|
|
7
|
+
import { FrameGraph } from './frameGraph.js';
|
|
8
|
+
import { glassNow, glassTiming } from './profile.js';
|
|
9
|
+
import { tabHeldGeometry } from './interactionProfiles.js';
|
|
10
|
+
import { RegionScene } from './regionScene.js';
|
|
11
|
+
import { glassFailureCode } from './errorCode.js';
|
|
12
|
+
import { TabMotion, TAB_INTERACTIVE_MOTION } from '../lens/tabMotion.js';
|
|
13
|
+
import { sampleRegion, sampleNavigation, } from './productionTracks.js';
|
|
14
|
+
import { ShapeCadence, validateTrack } from './cadence.js';
|
|
15
|
+
import { documentFrameClock } from './frameClock.js';
|
|
16
|
+
import { LayerDevice } from './layers.js';
|
|
17
|
+
import { takePresentedCanvases, WebGPURaster } from './raster.js';
|
|
18
|
+
import { Backdrop } from './backdrop.js';
|
|
19
|
+
import { trimShapeTop } from '../lens/drawableTop.js';
|
|
20
|
+
import { MenuLiftInput } from './menuLiftInput.js';
|
|
21
|
+
import { epochNow, poseAt, } from '../worker/protocol.js';
|
|
22
|
+
/** The same WebGPU engine can be driven by a worker port or by the page's
|
|
23
|
+
* rendering update. Thread ownership is selected once; it is never an error fallback. */
|
|
24
|
+
export function createWebGPURenderer(emit, clock = documentFrameClock) {
|
|
25
|
+
const cadence = new ShapeCadence();
|
|
26
|
+
glassTiming('renderer-start');
|
|
27
|
+
let firstPresent = false;
|
|
28
|
+
let preparedCanonicalDevice;
|
|
29
|
+
let hideEpoch = 0;
|
|
30
|
+
let presentationEpoch = 0;
|
|
31
|
+
let appearanceRefreshPending = false;
|
|
32
|
+
let appearanceInstallRevision;
|
|
33
|
+
let appearanceInstallHideEpoch;
|
|
34
|
+
let contentInstallRevision;
|
|
35
|
+
let contentInstallHideEpoch;
|
|
36
|
+
let deviceAppearanceRevision = 0;
|
|
37
|
+
const reportError = (stage, error, reason) => emit({
|
|
38
|
+
glassError: {
|
|
39
|
+
code: glassFailureCode(stage, error),
|
|
40
|
+
stage,
|
|
41
|
+
message: error instanceof Error ? error.message : String(error),
|
|
42
|
+
reason,
|
|
43
|
+
at: Date.now(),
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
let adapterRecoveryReady = false;
|
|
47
|
+
const owner = new LayerDevice(reportError, pending => {
|
|
48
|
+
adapterRecoveryReady = !pending;
|
|
49
|
+
if (pending)
|
|
50
|
+
emit({ adapterRecovery: true });
|
|
51
|
+
});
|
|
52
|
+
const submissionAllowed = () => visible &&
|
|
53
|
+
presentationEpoch === hideEpoch &&
|
|
54
|
+
!appearanceRefreshPending &&
|
|
55
|
+
appearanceInstallRevision === undefined &&
|
|
56
|
+
contentInstallRevision === undefined;
|
|
57
|
+
let reportedGate;
|
|
58
|
+
const publishPresentationGate = () => {
|
|
59
|
+
const allowed = submissionAllowed();
|
|
60
|
+
if (reportedGate === allowed)
|
|
61
|
+
return;
|
|
62
|
+
reportedGate = allowed;
|
|
63
|
+
emit({ glassEvent: { type: 'presentation-gate', allowed } });
|
|
64
|
+
};
|
|
65
|
+
const raster = new WebGPURaster();
|
|
66
|
+
raster.setSubmissionGate(submissionAllowed);
|
|
67
|
+
const layers = new Map([['chrome', raster]]);
|
|
68
|
+
const appRegions = new RegionScene(owner, event => emit({ glassEvent: event }), submissionAllowed);
|
|
69
|
+
let tab = new TabMotion(), sharedTabLift = false, reducedMotion = false;
|
|
70
|
+
const menuLift = new TabMotion(TAB_INTERACTIVE_MOTION);
|
|
71
|
+
let tabTiming;
|
|
72
|
+
const menuLiftRaster = () => layers.get('menu-lift') ?? regions.get('chrome-lift')?.get('menu-lift');
|
|
73
|
+
let navigationTrack, navigationInputAt = 0;
|
|
74
|
+
let navigationPose;
|
|
75
|
+
const tracks = new Map();
|
|
76
|
+
// Canvas submission has no scanout callback. This is an explicitly supplied
|
|
77
|
+
// experimental lead, not a latency inferred from rAF or GPU queue completion.
|
|
78
|
+
let presentationLeadMs = 0;
|
|
79
|
+
/** The scenes that sample the page's scroller with the chrome. */
|
|
80
|
+
const scrollFollowers = () => [
|
|
81
|
+
raster,
|
|
82
|
+
...(regions.get('chrome')?.values() ?? []),
|
|
83
|
+
...['chrome-lift', 'menu-lift'].flatMap(id => layers.has(id) ? [layers.get(id)] : []),
|
|
84
|
+
...(regions.get('chrome-lift')?.values() ?? []),
|
|
85
|
+
];
|
|
86
|
+
const sampleNavigationMotion = (at, now) => {
|
|
87
|
+
if (!navigationTrack)
|
|
88
|
+
return;
|
|
89
|
+
const pose = sampleNavigation(navigationTrack, at);
|
|
90
|
+
navigationPose = { key: navigationPose.key, pose };
|
|
91
|
+
raster.setNavigation(pose);
|
|
92
|
+
appRegions.setNavigation(pose, navigationPose.key, presentationLeadMs === 0);
|
|
93
|
+
if (now >= navigationTrack.epoch + navigationTrack.duration)
|
|
94
|
+
navigationTrack = undefined;
|
|
95
|
+
};
|
|
96
|
+
const sampleRegionMotion = (at, now) => {
|
|
97
|
+
for (const [id, track] of tracks) {
|
|
98
|
+
regionById(id)?.updateSpec(sampleRegion(track, at));
|
|
99
|
+
if (now >= track.epoch + track.duration)
|
|
100
|
+
tracks.delete(id);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
/** The … trigger's press lift: input ordering, early-contact hold and replay (menuLiftInput.ts). */
|
|
104
|
+
const menuInput = new MenuLiftInput({
|
|
105
|
+
surface: () => {
|
|
106
|
+
const surface = menuLiftRaster(), first = surface?.spec?.shape.first;
|
|
107
|
+
return surface && first ? { first } : undefined;
|
|
108
|
+
},
|
|
109
|
+
apply: (request, { first }) => {
|
|
110
|
+
const surface = menuLiftRaster();
|
|
111
|
+
if (request.phase === 'rest' || reducedMotion) {
|
|
112
|
+
menuLift.reset(0);
|
|
113
|
+
surface.setLift({ amount: 0, source: 'transmissive', optics: menuLift.optics() });
|
|
114
|
+
render(x);
|
|
115
|
+
}
|
|
116
|
+
else if (request.phase === 'pressed') {
|
|
117
|
+
menuLift.configure([first.halfWidth], first.halfWidth * 2, first.halfHeight * 2, first.halfWidth * 2);
|
|
118
|
+
menuLift.down(first.halfWidth, 0, request.at);
|
|
119
|
+
}
|
|
120
|
+
else if (request.phase === 'dragging')
|
|
121
|
+
menuLift.move(request.x ?? first.halfWidth);
|
|
122
|
+
else
|
|
123
|
+
menuLift.up(request.at);
|
|
124
|
+
wake();
|
|
125
|
+
},
|
|
126
|
+
fail: error => reportError('menu lift', error),
|
|
127
|
+
});
|
|
128
|
+
const regionById = (id) => id === 'chrome' ? raster : (layers.get(id) ?? regions.get('chrome')?.get(id));
|
|
129
|
+
const covered = new Set();
|
|
130
|
+
const regions = new Map();
|
|
131
|
+
/** Lag trace: the page scroll event whose position the surfaces currently hold. */
|
|
132
|
+
let scrollSequence;
|
|
133
|
+
/** Lag trace: loop frames and the probe sample that receives their GPU completion times. */
|
|
134
|
+
const tracedFrames = [];
|
|
135
|
+
let loopSample;
|
|
136
|
+
/** Lag trace: a present outside the frame loop (a message applied and drawn at once). */
|
|
137
|
+
function traceMessageRender(device) {
|
|
138
|
+
const submitted = epochNow();
|
|
139
|
+
const mark = lagMark({
|
|
140
|
+
stage: 'worker-render',
|
|
141
|
+
at: submitted,
|
|
142
|
+
sequence: scrollSequence,
|
|
143
|
+
values: { loop: false, presented: takePresentedCanvases() },
|
|
144
|
+
});
|
|
145
|
+
void device.queue.onSubmittedWorkDone().then(() => {
|
|
146
|
+
mark.values = { ...mark.values, doneMs: epochNow() - submitted };
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/** Lag trace: the renderer's marks, with each loop frame's GPU completion and GPU time. When the
|
|
150
|
+
* renderer runs in the document these are the page's marks too (one list per realm). */
|
|
151
|
+
function exportLagTrace() {
|
|
152
|
+
for (const { mark, sample } of tracedFrames)
|
|
153
|
+
mark.values = {
|
|
154
|
+
...mark.values,
|
|
155
|
+
doneMs: sample.doneMs,
|
|
156
|
+
gpuMs: sample.gpuMs,
|
|
157
|
+
passes: sample.passes ? JSON.stringify(sample.passes) : undefined,
|
|
158
|
+
};
|
|
159
|
+
return lagMarks();
|
|
160
|
+
}
|
|
161
|
+
const render = (x, additional = [], sampledAt) => {
|
|
162
|
+
// Encoding publishes frame-graph cache keys. A blocked submission must not
|
|
163
|
+
// cache work whose command buffer will be discarded.
|
|
164
|
+
if (!visible || !submissionAllowed())
|
|
165
|
+
return;
|
|
166
|
+
if (presentationLeadMs && sampledAt === undefined) {
|
|
167
|
+
// Messages can draw between animation callbacks. Refresh the same known
|
|
168
|
+
// trajectories here too; direct drag poses remain the latest actual input.
|
|
169
|
+
const now = epochNow();
|
|
170
|
+
const at = now + presentationLeadMs;
|
|
171
|
+
sampleNavigationMotion(at, now);
|
|
172
|
+
sampleRegionMotion(at, now);
|
|
173
|
+
appRegions.sample(now, at);
|
|
174
|
+
}
|
|
175
|
+
const renderHideEpoch = hideEpoch;
|
|
176
|
+
const canSubmit = () => submissionAllowed() && renderHideEpoch === hideEpoch;
|
|
177
|
+
// Preserve each canvas's region order while presenting each graph result to
|
|
178
|
+
// every layer before another material overwrites shared scratch storage.
|
|
179
|
+
const sequences = [...layers]
|
|
180
|
+
.filter(([id]) => !covered.has(id))
|
|
181
|
+
.map(([id, scene]) => [scene, ...(regions.get(id)?.values() ?? [])].filter(region => !!region.spec))
|
|
182
|
+
.concat([
|
|
183
|
+
...new Set([
|
|
184
|
+
...additional,
|
|
185
|
+
...(presentationLeadMs && appRegions.navigationActive
|
|
186
|
+
? appRegions.navigationRasters()
|
|
187
|
+
: []),
|
|
188
|
+
]),
|
|
189
|
+
].map(region => [region]));
|
|
190
|
+
const device = owner.liveDevice;
|
|
191
|
+
if (!device || lost || !sequences.some(s => s.length))
|
|
192
|
+
return;
|
|
193
|
+
// One encoder and one submission per frame; each canvas layer is presented in a
|
|
194
|
+
// single pass after all of its surfaces have encoded their private results.
|
|
195
|
+
gpuScope(device, 'draw', () => {
|
|
196
|
+
let encoded = [];
|
|
197
|
+
const encode = (e) => {
|
|
198
|
+
encoded = sequences.map(sequence => sequence.filter(scene => scene.encodeResult(e, x)));
|
|
199
|
+
if (!canSubmit())
|
|
200
|
+
return;
|
|
201
|
+
for (const sequence of encoded)
|
|
202
|
+
if (sequence.length)
|
|
203
|
+
WebGPURaster.presentLayer(e, sequence);
|
|
204
|
+
};
|
|
205
|
+
if (frameContext) {
|
|
206
|
+
loopSample = frameProbe.frame(frameContext.kind, frameContext.interval, frameContext.restart, encode, canSubmit);
|
|
207
|
+
frameContext = undefined;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
const e = device.createCommandEncoder();
|
|
211
|
+
encode(e);
|
|
212
|
+
const commands = e.finish();
|
|
213
|
+
if (!canSubmit())
|
|
214
|
+
return;
|
|
215
|
+
submitCanvasCommands(device, e, commands);
|
|
216
|
+
if (lagTraceEnabled())
|
|
217
|
+
traceMessageRender(device);
|
|
218
|
+
}
|
|
219
|
+
if (!canSubmit())
|
|
220
|
+
return;
|
|
221
|
+
for (const sequence of encoded)
|
|
222
|
+
for (const scene of sequence)
|
|
223
|
+
scene.submitted();
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
// Phone probe: frame evidence per interaction kind, posted when a motion loop goes idle.
|
|
227
|
+
const frameProbe = new FrameProbe(summary => emit({ glassFrames: summary }));
|
|
228
|
+
let frameContext;
|
|
229
|
+
let plan, handle = 0, visible = true, lost = false, x = 0, inputAt = 0, previous, callbacks = 0;
|
|
230
|
+
let frames = [], sourceRevision = 0, sharedRevision = 0, dirty = false;
|
|
231
|
+
// Shared capture slots: each image crosses the thread boundary once and every
|
|
232
|
+
// layer/region raster borrows it through the frame graph under its content key.
|
|
233
|
+
// Chrome glyph slots are independent of navigation replacing the root raster's ink.
|
|
234
|
+
const shared = new Map();
|
|
235
|
+
const retainedPlanes = new Map();
|
|
236
|
+
/** Images kept alive beyond their slot (`keep`), to be installed again by key, each with the
|
|
237
|
+
* glyph texture a raster uploaded it to: without that lease the texture died with the raster's
|
|
238
|
+
* and coming back to the ink uploaded it again (12 to 33 ms for a phone's tab bar ink). */
|
|
239
|
+
const keptImages = new Map();
|
|
240
|
+
/** Uploaded textures a slot holds alongside its image (a restored retained plane). */
|
|
241
|
+
const slotTextures = new Map();
|
|
242
|
+
const releaseSlot = (slot) => {
|
|
243
|
+
shared.get(slot)?.release();
|
|
244
|
+
shared.delete(slot);
|
|
245
|
+
slotTextures.get(slot)?.release();
|
|
246
|
+
slotTextures.delete(slot);
|
|
247
|
+
};
|
|
248
|
+
const sharedImage = (key) => {
|
|
249
|
+
for (const lease of shared.values())
|
|
250
|
+
if (lease.key === key)
|
|
251
|
+
return lease.value;
|
|
252
|
+
throw Error('Shared glass source is not installed: ' + key);
|
|
253
|
+
};
|
|
254
|
+
const images = (request) => {
|
|
255
|
+
if (request.front && request.rear && request.glyphs)
|
|
256
|
+
return [request.front, request.rear, request.glyphs];
|
|
257
|
+
if (request.front || request.rear || request.glyphs)
|
|
258
|
+
throw Error('Glass source request must carry all three images or none');
|
|
259
|
+
const front = sharedImage(request.setup.sourceKey + ':front');
|
|
260
|
+
return [front, front, sharedImage(request.setup.glyphKey)];
|
|
261
|
+
};
|
|
262
|
+
// Revisions are assigned in post order; an older message is superseded work, dropped quietly.
|
|
263
|
+
const superseded = (revision) => revision !== undefined && revision < sharedRevision;
|
|
264
|
+
const closeImages = (request) => {
|
|
265
|
+
for (const image of new Set([request.front, request.rear, request.glyphs]))
|
|
266
|
+
image?.close();
|
|
267
|
+
};
|
|
268
|
+
/** Requests waiting for the next worker frame to have been presented. */
|
|
269
|
+
let frameWaiters = [];
|
|
270
|
+
const releaseFrameWaiters = (error) => {
|
|
271
|
+
const waiting = frameWaiters;
|
|
272
|
+
frameWaiters = [];
|
|
273
|
+
for (const waiter of waiting)
|
|
274
|
+
if (error)
|
|
275
|
+
waiter.reject(error);
|
|
276
|
+
else
|
|
277
|
+
waiter.resolve();
|
|
278
|
+
};
|
|
279
|
+
const cancel = () => {
|
|
280
|
+
if (handle)
|
|
281
|
+
clock.cancel(handle);
|
|
282
|
+
handle = 0;
|
|
283
|
+
looping = false;
|
|
284
|
+
releaseFrameWaiters(Error('Navigation frame cancelled'));
|
|
285
|
+
};
|
|
286
|
+
/** A region scene or source applied from a message presents outside the frame loop; it is sampled
|
|
287
|
+
* like a loop frame so the gate sees every present (restart: its interval may span idle time). */
|
|
288
|
+
const messageFrame = (message) => {
|
|
289
|
+
const at = epochNow();
|
|
290
|
+
frames.push({
|
|
291
|
+
at,
|
|
292
|
+
late: 0,
|
|
293
|
+
interval: previous === undefined ? null : at - previous,
|
|
294
|
+
cpuMs: 0,
|
|
295
|
+
x,
|
|
296
|
+
expectedX: x,
|
|
297
|
+
errorPx: 0,
|
|
298
|
+
inputAgeMs: at - inputAt,
|
|
299
|
+
draws: 0,
|
|
300
|
+
uploads: 0,
|
|
301
|
+
copies: 0,
|
|
302
|
+
restart: true,
|
|
303
|
+
message,
|
|
304
|
+
});
|
|
305
|
+
if (frames.length > 2400)
|
|
306
|
+
frames.shift();
|
|
307
|
+
if (lagTraceEnabled())
|
|
308
|
+
lagMark({ stage: 'worker-message-frame', at, sequence: scrollSequence, values: { message } });
|
|
309
|
+
previous = at;
|
|
310
|
+
callbacks++;
|
|
311
|
+
};
|
|
312
|
+
// A frame that (re)starts an idle loop has an interval spanning idle time, not a stall.
|
|
313
|
+
let looping = false, restarted = false;
|
|
314
|
+
const wake = () => {
|
|
315
|
+
if (handle ||
|
|
316
|
+
(!dirty &&
|
|
317
|
+
!plan &&
|
|
318
|
+
!tracks.size &&
|
|
319
|
+
!tab.needsFrame &&
|
|
320
|
+
!menuLift.needsFrame &&
|
|
321
|
+
!appRegions.active &&
|
|
322
|
+
!navigationTrack &&
|
|
323
|
+
!Backdrop.for(owner).keyboardMoving) ||
|
|
324
|
+
!visible ||
|
|
325
|
+
lost ||
|
|
326
|
+
![...layers.keys()].some(id => !covered.has(id)))
|
|
327
|
+
return;
|
|
328
|
+
handle = clock.request(tick);
|
|
329
|
+
};
|
|
330
|
+
const presentTabSelection = () => {
|
|
331
|
+
if (!raster.spec?.tabSelection)
|
|
332
|
+
return;
|
|
333
|
+
const spec = raster.spec;
|
|
334
|
+
const current = {
|
|
335
|
+
...spec,
|
|
336
|
+
tabSelection: {
|
|
337
|
+
...spec.tabSelection,
|
|
338
|
+
capsule: tab.capsule(),
|
|
339
|
+
lensMix: sharedTabLift ? 0 : tab.lensMix,
|
|
340
|
+
// The lift overlay replaces the resting pill as its measured press rises.
|
|
341
|
+
restMix: sharedTabLift ? 1 - tab.lensMix : 1,
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
raster.updateSpec(current);
|
|
345
|
+
const overlay = layers.get('chrome-lift');
|
|
346
|
+
if (sharedTabLift && overlay?.spec) {
|
|
347
|
+
overlay.updateSpec(current);
|
|
348
|
+
overlay.setLift({ amount: tab.lensMix, source: 'composed', optics: tab.optics() });
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
const tick = (at) => {
|
|
352
|
+
handle = 0;
|
|
353
|
+
if ((!dirty &&
|
|
354
|
+
!plan &&
|
|
355
|
+
!tracks.size &&
|
|
356
|
+
!tab.needsFrame &&
|
|
357
|
+
!menuLift.needsFrame &&
|
|
358
|
+
!appRegions.active &&
|
|
359
|
+
!navigationTrack &&
|
|
360
|
+
!Backdrop.for(owner).keyboardMoving) ||
|
|
361
|
+
!visible ||
|
|
362
|
+
lost ||
|
|
363
|
+
appearanceRefreshPending) {
|
|
364
|
+
if (looping)
|
|
365
|
+
frameProbe.flush();
|
|
366
|
+
looping = false;
|
|
367
|
+
releaseFrameWaiters(Error('Navigation frame unavailable'));
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
if (!cadence.admit(at)) {
|
|
371
|
+
wake();
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
const tickHideEpoch = hideEpoch;
|
|
375
|
+
restarted = !looping;
|
|
376
|
+
looping = true;
|
|
377
|
+
const kind = tab.needsFrame || menuLift.needsFrame || appRegions.pressing
|
|
378
|
+
? 'drag'
|
|
379
|
+
: tracks.has('chrome')
|
|
380
|
+
? 'minimize'
|
|
381
|
+
: tracks.has('menu') || tracks.has('right')
|
|
382
|
+
? 'menu'
|
|
383
|
+
: navigationTrack
|
|
384
|
+
? 'navigation'
|
|
385
|
+
: dirty
|
|
386
|
+
? 'scroll'
|
|
387
|
+
: appRegions.active
|
|
388
|
+
? 'region'
|
|
389
|
+
: 'other';
|
|
390
|
+
dirty = false;
|
|
391
|
+
const callbackDelayMs = epochNow() - at, sampleAt = at + presentationLeadMs, expectedX = plan ? poseAt(plan, at) : x, start = performance.now();
|
|
392
|
+
try {
|
|
393
|
+
const backdrop = Backdrop.for(owner);
|
|
394
|
+
if (backdrop.keyboardMoving && backdrop.sampleKeyboard(at))
|
|
395
|
+
appRegions.backdropMoved();
|
|
396
|
+
sampleNavigationMotion(sampleAt, at);
|
|
397
|
+
const tabChanged = tab.needsFrame && !!raster.spec?.tabSelection;
|
|
398
|
+
if (tabChanged) {
|
|
399
|
+
if (tabTiming && tabTiming.firstFrame === undefined)
|
|
400
|
+
tabTiming.firstFrame = at;
|
|
401
|
+
tab.sample(at, reducedMotion);
|
|
402
|
+
}
|
|
403
|
+
if (menuLift.needsFrame) {
|
|
404
|
+
menuLift.sample(at, reducedMotion);
|
|
405
|
+
const surface = menuLiftRaster(), first = surface?.spec?.shape.first;
|
|
406
|
+
// The lens grows about the trigger; on a fitted page it is lowered, never cut, at the drawable top.
|
|
407
|
+
if (surface && first) {
|
|
408
|
+
const c = menuLift.capsule(), lens = trimShapeTop({ centerY: first.centerY, halfHeight: c.halfHeight }, surface.spec.frameY);
|
|
409
|
+
surface.setLift({
|
|
410
|
+
amount: menuLift.lensMix,
|
|
411
|
+
source: 'transmissive',
|
|
412
|
+
optics: menuLift.optics(),
|
|
413
|
+
glyphLayout: 'content',
|
|
414
|
+
glyphVibrancy: [0, 0],
|
|
415
|
+
capsule: {
|
|
416
|
+
...c,
|
|
417
|
+
centerX: first.centerX,
|
|
418
|
+
centerY: lens.centerY,
|
|
419
|
+
halfHeight: lens.halfHeight,
|
|
420
|
+
radius: Math.min(c.halfWidth, lens.halfHeight),
|
|
421
|
+
},
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
sampleRegionMotion(sampleAt, at);
|
|
426
|
+
// A restore track owns the platter shape; a held gesture owns its selection.
|
|
427
|
+
// Reapply even after lift settles, while the track continues sampling.
|
|
428
|
+
if (tabChanged || tab.active)
|
|
429
|
+
presentTabSelection();
|
|
430
|
+
if (plan?.mode === 'timeline')
|
|
431
|
+
x = expectedX;
|
|
432
|
+
frameContext = {
|
|
433
|
+
kind,
|
|
434
|
+
interval: previous === undefined || restarted ? null : at - previous,
|
|
435
|
+
restart: restarted,
|
|
436
|
+
};
|
|
437
|
+
loopSample = undefined;
|
|
438
|
+
appRegions.sample(at, sampleAt);
|
|
439
|
+
render(x, [], sampleAt);
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
frameContext = undefined;
|
|
443
|
+
plan = undefined;
|
|
444
|
+
navigationTrack = undefined;
|
|
445
|
+
looping = false;
|
|
446
|
+
releaseFrameWaiters(error);
|
|
447
|
+
reportError('frame submission', error);
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
if (!visible || tickHideEpoch !== hideEpoch) {
|
|
451
|
+
frameContext = undefined;
|
|
452
|
+
looping = false;
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
callbacks++;
|
|
456
|
+
frames.push({
|
|
457
|
+
at,
|
|
458
|
+
late: 0,
|
|
459
|
+
interval: previous === undefined ? null : at - previous,
|
|
460
|
+
cpuMs: performance.now() - start,
|
|
461
|
+
x,
|
|
462
|
+
expectedX,
|
|
463
|
+
errorPx: Math.abs(x - expectedX),
|
|
464
|
+
inputAgeMs: at - inputAt,
|
|
465
|
+
draws: 0,
|
|
466
|
+
uploads: 0,
|
|
467
|
+
copies: 0,
|
|
468
|
+
restart: restarted,
|
|
469
|
+
callbackDelayMs,
|
|
470
|
+
});
|
|
471
|
+
if (frames.length > 2400)
|
|
472
|
+
frames.shift();
|
|
473
|
+
if (lagTraceEnabled()) {
|
|
474
|
+
const mark = lagMark({
|
|
475
|
+
stage: 'worker-frame',
|
|
476
|
+
at,
|
|
477
|
+
ms: performance.now() - start,
|
|
478
|
+
sequence: scrollSequence,
|
|
479
|
+
values: {
|
|
480
|
+
kind,
|
|
481
|
+
late: 0,
|
|
482
|
+
interval: previous === undefined ? null : at - previous,
|
|
483
|
+
restart: restarted,
|
|
484
|
+
clock: 'page-raf',
|
|
485
|
+
callbackDelayMs,
|
|
486
|
+
presented: takePresentedCanvases(),
|
|
487
|
+
tabCentre: tab.frame.centre,
|
|
488
|
+
tabActive: tab.needsFrame,
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
if (loopSample && lagTraceHasRoom())
|
|
492
|
+
tracedFrames.push({ mark, sample: loopSample });
|
|
493
|
+
// When this thread's event loop next runs a task: the time after the frame during which it
|
|
494
|
+
// could not receive messages (in a worker, WebKit presents the frame's canvases first).
|
|
495
|
+
const ended = epochNow();
|
|
496
|
+
setTimeout(() => {
|
|
497
|
+
mark.values = { ...mark.values, resumeMs: epochNow() - ended };
|
|
498
|
+
}, 0);
|
|
499
|
+
}
|
|
500
|
+
previous = at;
|
|
501
|
+
releaseFrameWaiters();
|
|
502
|
+
if (plan && at >= plan.epoch + plan.duration)
|
|
503
|
+
plan = undefined;
|
|
504
|
+
wake();
|
|
505
|
+
if (!handle) {
|
|
506
|
+
if (looping)
|
|
507
|
+
frameProbe.flush();
|
|
508
|
+
looping = false;
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
owner.subscribe(device => {
|
|
512
|
+
frameProbe.useDevice(device);
|
|
513
|
+
lost = !device;
|
|
514
|
+
if (!device) {
|
|
515
|
+
cancel();
|
|
516
|
+
void appRegions.request({ type: 'visibility', visible: false }).catch(error => {
|
|
517
|
+
reportError('device loss suspension', error);
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
// Raster restoration rebuilds resources only. The page owns appearance;
|
|
522
|
+
// no restored-device draw or presentation is allowed before its fresh reply.
|
|
523
|
+
appearanceRefreshPending = true;
|
|
524
|
+
const appearanceRevision = ++deviceAppearanceRevision;
|
|
525
|
+
queueMicrotask(() => {
|
|
526
|
+
if (owner.liveDevice !== device)
|
|
527
|
+
return;
|
|
528
|
+
emit({ appearanceRefresh: true, appearanceRevision });
|
|
529
|
+
if (firstPresent)
|
|
530
|
+
setTimeout(prewarm, 1000);
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
publishPresentationGate();
|
|
534
|
+
});
|
|
535
|
+
// After the first present, compile every material kernel in the background so no surface's
|
|
536
|
+
// first use (alerts, sheets, menus) compiles on the queue during its entrance motion.
|
|
537
|
+
/** Background kernel compilation after the first present, and again on every restored device.
|
|
538
|
+
* Failures are reported (a failure on a device lost meanwhile belongs to the loss, not the kernels). */
|
|
539
|
+
const prewarm = () => {
|
|
540
|
+
const device = owner.liveDevice;
|
|
541
|
+
if (!device)
|
|
542
|
+
return;
|
|
543
|
+
const at = glassNow();
|
|
544
|
+
void prewarmKernels(device).then(() => glassTiming('kernels-prewarmed', at), error => {
|
|
545
|
+
if (owner.liveDevice === device)
|
|
546
|
+
reportError('kernel prewarm', error);
|
|
547
|
+
});
|
|
548
|
+
};
|
|
549
|
+
// Serialize asynchronous init/readback/source operations; motion remains worker-owned.
|
|
550
|
+
let requests = Promise.resolve();
|
|
551
|
+
let receivedAppearance;
|
|
552
|
+
let restoredAppearance;
|
|
553
|
+
const receiveAppearance = (value, reducedMotion = false) => {
|
|
554
|
+
// visibilitychange and pageshow describe the same foreground arrival. An identical
|
|
555
|
+
// payload must not make an in-flight restore repeat its texture uploads.
|
|
556
|
+
if (receivedAppearance?.value === value && receivedAppearance.reducedMotion === reducedMotion)
|
|
557
|
+
return;
|
|
558
|
+
receivedAppearance = { value, reducedMotion };
|
|
559
|
+
};
|
|
560
|
+
const receive = (event) => {
|
|
561
|
+
const { id, request } = event.data;
|
|
562
|
+
if (request.type === 'adapter-visibility') {
|
|
563
|
+
owner.setAdapterVisible(request.visible);
|
|
564
|
+
if (id)
|
|
565
|
+
emit({ id, value: {} });
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
if (request.type === 'retry-adapter') {
|
|
569
|
+
// Acquisition may be holding the serialized renderer queue. Wake it out of band.
|
|
570
|
+
const retry = owner.retryAdapter();
|
|
571
|
+
void Promise.resolve(retry).then(() => {
|
|
572
|
+
if (id)
|
|
573
|
+
emit({ id, value: { requested: true } });
|
|
574
|
+
}, error => {
|
|
575
|
+
if (id)
|
|
576
|
+
emit({ id, error: String(error) });
|
|
577
|
+
});
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
if (request.type === 'visible' && request.visible && request.appearance) {
|
|
581
|
+
receiveAppearance(request.appearance, request.reducedMotion);
|
|
582
|
+
}
|
|
583
|
+
else if (request.type === 'canonical' && request.request.type === 'appearance') {
|
|
584
|
+
receiveAppearance(request.request.value, request.request.reducedMotion);
|
|
585
|
+
}
|
|
586
|
+
if (request.type === 'visible' && !request.visible) {
|
|
587
|
+
// Hide is an out-of-band cancellation barrier, not queued behind GPU waits.
|
|
588
|
+
hideEpoch++;
|
|
589
|
+
visible = false;
|
|
590
|
+
cancel();
|
|
591
|
+
for (const scene of [
|
|
592
|
+
...layers.values(),
|
|
593
|
+
...[...regions.values()].flatMap(list => [...list.values()]),
|
|
594
|
+
])
|
|
595
|
+
scene.setVisible(false);
|
|
596
|
+
void appRegions.request({ type: 'visibility', visible: false }).catch(error => {
|
|
597
|
+
reportError('hide barrier', error);
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
if (request.type === 'appearance-begin') {
|
|
601
|
+
// Close the presentation gate on receipt, even while an older GPU request awaits.
|
|
602
|
+
// The queued handler must never restore a superseded revision.
|
|
603
|
+
appearanceInstallRevision = request.revision;
|
|
604
|
+
appearanceInstallHideEpoch = hideEpoch;
|
|
605
|
+
}
|
|
606
|
+
if (request.type === 'content-begin') {
|
|
607
|
+
contentInstallRevision = request.revision;
|
|
608
|
+
contentInstallHideEpoch = hideEpoch;
|
|
609
|
+
}
|
|
610
|
+
publishPresentationGate();
|
|
611
|
+
const receivedHideEpoch = hideEpoch;
|
|
612
|
+
const received = epochNow();
|
|
613
|
+
const postedAt = event.data.postedAt;
|
|
614
|
+
if (postedAt !== undefined &&
|
|
615
|
+
['source', 'source-images', 'layer-source', 'canonical'].includes(request.type))
|
|
616
|
+
glassTiming('transport', postedAt, request.type);
|
|
617
|
+
const requestMark = lagTraceEnabled()
|
|
618
|
+
? lagMark({
|
|
619
|
+
stage: 'worker-request',
|
|
620
|
+
at: received,
|
|
621
|
+
sequence: request.type === 'source-scroll' ? request.sequence : undefined,
|
|
622
|
+
values: {
|
|
623
|
+
type: request.type === 'canonical' ? 'canonical:' + request.request.type : request.type,
|
|
624
|
+
postedAt,
|
|
625
|
+
},
|
|
626
|
+
})
|
|
627
|
+
: undefined;
|
|
628
|
+
requests = requests
|
|
629
|
+
.then(async () => {
|
|
630
|
+
if (requestMark)
|
|
631
|
+
requestMark.values = { ...requestMark.values, startedAt: glassNow() };
|
|
632
|
+
const started = glassNow(), profiled = [
|
|
633
|
+
'source',
|
|
634
|
+
'source-images',
|
|
635
|
+
'layer-source',
|
|
636
|
+
'canonical',
|
|
637
|
+
'init',
|
|
638
|
+
'capability',
|
|
639
|
+
].includes(request.type);
|
|
640
|
+
if (profiled)
|
|
641
|
+
glassTiming('worker-queue', received, request.type);
|
|
642
|
+
let value;
|
|
643
|
+
switch (request.type) {
|
|
644
|
+
case 'content-begin':
|
|
645
|
+
break;
|
|
646
|
+
case 'content-commit':
|
|
647
|
+
value = { accepted: false, revision: request.revision };
|
|
648
|
+
if (contentInstallRevision === request.revision &&
|
|
649
|
+
contentInstallHideEpoch === hideEpoch) {
|
|
650
|
+
contentInstallRevision = undefined;
|
|
651
|
+
contentInstallHideEpoch = undefined;
|
|
652
|
+
value = { accepted: true, revision: request.revision };
|
|
653
|
+
appRegions.present();
|
|
654
|
+
render(x);
|
|
655
|
+
}
|
|
656
|
+
break;
|
|
657
|
+
case 'lens-debug':
|
|
658
|
+
for (const scene of [
|
|
659
|
+
...layers.values(),
|
|
660
|
+
...[...regions.values()].flatMap(list => [...list.values()]),
|
|
661
|
+
])
|
|
662
|
+
scene.setLensDebug(request.view);
|
|
663
|
+
appRegions.setLensDebug(request.view);
|
|
664
|
+
render(x);
|
|
665
|
+
value = { view: request.view };
|
|
666
|
+
break;
|
|
667
|
+
case 'appearance-begin':
|
|
668
|
+
// Installed out of band above, like the hide cancellation barrier.
|
|
669
|
+
break;
|
|
670
|
+
case 'appearance-commit':
|
|
671
|
+
// A capture started before hide cannot release the resumed submission gate.
|
|
672
|
+
value = { accepted: false, revision: request.revision };
|
|
673
|
+
if (appearanceInstallRevision === request.revision &&
|
|
674
|
+
appearanceInstallHideEpoch === hideEpoch) {
|
|
675
|
+
appearanceInstallRevision = undefined;
|
|
676
|
+
appearanceInstallHideEpoch = undefined;
|
|
677
|
+
value = { accepted: true, revision: request.revision };
|
|
678
|
+
appRegions.present();
|
|
679
|
+
render(x);
|
|
680
|
+
}
|
|
681
|
+
break;
|
|
682
|
+
case 'canonical': {
|
|
683
|
+
if (request.request.type === 'appearance') {
|
|
684
|
+
for (const scene of [
|
|
685
|
+
...layers.values(),
|
|
686
|
+
...[...regions.values()].flatMap(list => [...list.values()]),
|
|
687
|
+
])
|
|
688
|
+
scene.setAppearance(request.request.value);
|
|
689
|
+
}
|
|
690
|
+
value = await appRegions.request(request.request);
|
|
691
|
+
// Canonical production does not send the legacy source/layer-source messages
|
|
692
|
+
// that schedule background prewarming. Finish compilation before acknowledging
|
|
693
|
+
// its first device-backed setup, while the app still holds launch readiness.
|
|
694
|
+
// Only menu kernels gate launch; the remaining surfaces warm in the background.
|
|
695
|
+
const canonicalDevice = owner.liveDevice;
|
|
696
|
+
if (canonicalDevice && canonicalDevice !== preparedCanonicalDevice) {
|
|
697
|
+
const started = glassNow();
|
|
698
|
+
await prewarmKernels(canonicalDevice, ['menu', 'ink', 'contextComposite']);
|
|
699
|
+
preparedCanonicalDevice = canonicalDevice;
|
|
700
|
+
glassTiming('menu-kernels-prewarmed', started);
|
|
701
|
+
setTimeout(prewarm, 1000);
|
|
702
|
+
}
|
|
703
|
+
if (request.request.type === 'appearance') {
|
|
704
|
+
if (appearanceRefreshPending &&
|
|
705
|
+
request.appearanceRevision === deviceAppearanceRevision) {
|
|
706
|
+
const graph = FrameGraph.for(owner);
|
|
707
|
+
for (const [role, entries] of [
|
|
708
|
+
['front', retainedPlanes],
|
|
709
|
+
['glyphs', keptImages],
|
|
710
|
+
])
|
|
711
|
+
for (const retained of entries.values()) {
|
|
712
|
+
retained.texture.release();
|
|
713
|
+
retained.texture = graph.target(role, retained.image.value.width, retained.image.value.height, false, retained.image.key);
|
|
714
|
+
graph.upload(retained.image.value, retained.texture.value);
|
|
715
|
+
}
|
|
716
|
+
for (const [slot, texture] of slotTextures) {
|
|
717
|
+
const image = shared.get(slot);
|
|
718
|
+
texture.release();
|
|
719
|
+
if (!image) {
|
|
720
|
+
slotTextures.delete(slot);
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
const replacement = graph.target('front', image.value.width, image.value.height, false, image.key);
|
|
724
|
+
slotTextures.set(slot, replacement);
|
|
725
|
+
graph.upload(image.value, replacement.value);
|
|
726
|
+
}
|
|
727
|
+
if (visible && receivedHideEpoch === hideEpoch) {
|
|
728
|
+
await appRegions.prepareResume();
|
|
729
|
+
if (visible && receivedHideEpoch === hideEpoch) {
|
|
730
|
+
appearanceRefreshPending = false;
|
|
731
|
+
appRegions.present();
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
await appRegions.request({ type: 'visibility', visible: false });
|
|
735
|
+
appearanceRefreshPending = false;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
else
|
|
739
|
+
appearanceRefreshPending = false;
|
|
740
|
+
}
|
|
741
|
+
render(x);
|
|
742
|
+
}
|
|
743
|
+
if (request.request.type === 'scene' || request.request.type === 'source')
|
|
744
|
+
messageFrame(request.request.type);
|
|
745
|
+
wake();
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
case 'navigation-track':
|
|
749
|
+
if (request.track.epoch >= navigationInputAt) {
|
|
750
|
+
navigationInputAt = request.track.epoch;
|
|
751
|
+
navigationTrack = request.track;
|
|
752
|
+
navigationPose = {
|
|
753
|
+
key: request.key,
|
|
754
|
+
pose: sampleNavigation(request.track, epochNow() + presentationLeadMs),
|
|
755
|
+
};
|
|
756
|
+
wake();
|
|
757
|
+
}
|
|
758
|
+
break;
|
|
759
|
+
case 'navigation-atlas': {
|
|
760
|
+
if (request.revision < sharedRevision) {
|
|
761
|
+
for (const cell of request.cells)
|
|
762
|
+
if ('image' in cell)
|
|
763
|
+
cell.image.close();
|
|
764
|
+
value = { superseded: true };
|
|
765
|
+
break;
|
|
766
|
+
}
|
|
767
|
+
sharedRevision = request.revision;
|
|
768
|
+
const device = owner.liveDevice;
|
|
769
|
+
if (!device)
|
|
770
|
+
throw Error('Navigation atlas has no live device');
|
|
771
|
+
const graph = FrameGraph.for(owner), key = request.key + ':front';
|
|
772
|
+
const replay = await retainNavigationAtlas(graph, request);
|
|
773
|
+
const lease = graph.virtual(key, request.width, request.height, replay);
|
|
774
|
+
let target;
|
|
775
|
+
const started = glassNow();
|
|
776
|
+
try {
|
|
777
|
+
target = graph.target('front', request.width, request.height, false, key);
|
|
778
|
+
gpuScope(device, 'navigation atlas', () => {
|
|
779
|
+
graph.reconstructVirtual(key);
|
|
780
|
+
});
|
|
781
|
+
graph.markUploaded(target.value);
|
|
782
|
+
releaseSlot('navigation');
|
|
783
|
+
shared.set('navigation', lease);
|
|
784
|
+
slotTextures.set('navigation', target);
|
|
785
|
+
}
|
|
786
|
+
catch (error) {
|
|
787
|
+
lease.release();
|
|
788
|
+
target?.release();
|
|
789
|
+
throw error;
|
|
790
|
+
}
|
|
791
|
+
glassTiming('navigation-atlas-gpu', started);
|
|
792
|
+
value = { slots: [...shared.keys()] };
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
795
|
+
case 'navigation-pose':
|
|
796
|
+
if (request.at >= navigationInputAt) {
|
|
797
|
+
navigationInputAt = request.at;
|
|
798
|
+
navigationTrack = undefined;
|
|
799
|
+
navigationPose = { key: request.key, pose: request.pose };
|
|
800
|
+
raster.setNavigation(request.pose);
|
|
801
|
+
appRegions.setNavigation(request.pose, request.key);
|
|
802
|
+
render(x);
|
|
803
|
+
}
|
|
804
|
+
break;
|
|
805
|
+
case 'navigation-regions': {
|
|
806
|
+
// The dock's first navigation frame goes first: installing every region presenter before it
|
|
807
|
+
// delayed the dock's motion onset by a worker frame (the regions follow from the next frame).
|
|
808
|
+
if (!request.prepare && raster.navigationRoutes > 1 && handle)
|
|
809
|
+
await new Promise((resolve, reject) => frameWaiters.push({ resolve, reject }));
|
|
810
|
+
const lease = shared.get('navigation');
|
|
811
|
+
if (!lease || lease.key !== request.key + ':front')
|
|
812
|
+
throw Error('Navigation atlas is not installed for glass regions');
|
|
813
|
+
await appRegions.navigationSource({
|
|
814
|
+
key: request.key,
|
|
815
|
+
lease,
|
|
816
|
+
routes: request.routes,
|
|
817
|
+
contentLayer: request.contentLayer,
|
|
818
|
+
width: request.width,
|
|
819
|
+
height: request.height,
|
|
820
|
+
pose: navigationPose?.key === request.key
|
|
821
|
+
? navigationTrack
|
|
822
|
+
? sampleNavigation(navigationTrack, epochNow() + presentationLeadMs)
|
|
823
|
+
: navigationPose.pose
|
|
824
|
+
: undefined,
|
|
825
|
+
rows: request.rows,
|
|
826
|
+
deferPresent: request.prepare ? false : !!navigationTrack,
|
|
827
|
+
});
|
|
828
|
+
value = { navigation: request.key };
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
case 'surface-input':
|
|
832
|
+
menuInput.input(request);
|
|
833
|
+
break;
|
|
834
|
+
case 'tab-config':
|
|
835
|
+
reducedMotion = !!request.reducedMotion;
|
|
836
|
+
sharedTabLift = !!request.sharedLift;
|
|
837
|
+
tab.configure(request.centres, request.width, request.height, request.dockWidth, {
|
|
838
|
+
selected: request.selected,
|
|
839
|
+
centerY: request.centerY,
|
|
840
|
+
parameters: sharedTabLift ? TAB_INTERACTIVE_MOTION : undefined,
|
|
841
|
+
heldGeometry: sharedTabLift
|
|
842
|
+
? tabHeldGeometry(request.width, request.height, request.dockWidth, request.placement)
|
|
843
|
+
: undefined,
|
|
844
|
+
widths: request.widths,
|
|
845
|
+
});
|
|
846
|
+
break;
|
|
847
|
+
case 'tab-input': {
|
|
848
|
+
if (request.event === 'down') {
|
|
849
|
+
tabTiming = { sent: request.at, received, handled: epochNow() };
|
|
850
|
+
tab.down(request.x, request.index, request.at);
|
|
851
|
+
}
|
|
852
|
+
else if (request.event === 'move')
|
|
853
|
+
tab.move(request.x);
|
|
854
|
+
else if (request.event === 'up')
|
|
855
|
+
tab.up(request.at, request.cancelled, request.index);
|
|
856
|
+
else if (request.event === 'select')
|
|
857
|
+
tab.select(request.index, request.at);
|
|
858
|
+
else if (!tab.active || request.cancelled) {
|
|
859
|
+
tab.reset(request.index);
|
|
860
|
+
if (raster.spec?.tabSelection) {
|
|
861
|
+
const spec = raster.spec;
|
|
862
|
+
raster.updateSpec({
|
|
863
|
+
...spec,
|
|
864
|
+
tabSelection: {
|
|
865
|
+
...spec.tabSelection,
|
|
866
|
+
capsule: tab.capsule(),
|
|
867
|
+
lensMix: 0,
|
|
868
|
+
restMix: 1,
|
|
869
|
+
},
|
|
870
|
+
});
|
|
871
|
+
const overlay = layers.get('chrome-lift');
|
|
872
|
+
if (overlay?.spec) {
|
|
873
|
+
overlay.updateSpec(raster.spec);
|
|
874
|
+
overlay.setLift({ amount: 0, source: 'composed', optics: tab.optics() });
|
|
875
|
+
}
|
|
876
|
+
render(x);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
wake();
|
|
880
|
+
break;
|
|
881
|
+
}
|
|
882
|
+
case 'region-track':
|
|
883
|
+
if (!regionById(request.track.id))
|
|
884
|
+
throw Error('Unknown region track');
|
|
885
|
+
tracks.set(request.track.id, request.track);
|
|
886
|
+
wake();
|
|
887
|
+
break;
|
|
888
|
+
case 'region-spec': {
|
|
889
|
+
const region = regionById(request.id);
|
|
890
|
+
if (!region)
|
|
891
|
+
throw Error('Unknown region');
|
|
892
|
+
tracks.delete(request.id);
|
|
893
|
+
region.updateSpec(request.spec);
|
|
894
|
+
render(x);
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
case 'lag-trace':
|
|
898
|
+
setLagTrace(request.enabled);
|
|
899
|
+
tracedFrames.length = 0;
|
|
900
|
+
break;
|
|
901
|
+
case 'source-scroll':
|
|
902
|
+
scrollSequence = request.sequence;
|
|
903
|
+
for (const scene of scrollFollowers()) {
|
|
904
|
+
scene.setScroll(request.y);
|
|
905
|
+
if (request.trigger)
|
|
906
|
+
scene.setTrigger(request.trigger);
|
|
907
|
+
}
|
|
908
|
+
if (request.layer &&
|
|
909
|
+
Backdrop.for(owner).setScroll(request.layer, request.x ?? 0, request.y))
|
|
910
|
+
appRegions.backdropMoved();
|
|
911
|
+
dirty = true;
|
|
912
|
+
wake();
|
|
913
|
+
break;
|
|
914
|
+
case 'backdrop-keyboard':
|
|
915
|
+
for (const layer of request.layers)
|
|
916
|
+
Backdrop.for(owner).setKeyboard(layer.id, layer.key, layer.keyboard, layer.scroll);
|
|
917
|
+
if (Backdrop.for(owner).sampleKeyboard(epochNow()))
|
|
918
|
+
appRegions.backdropMoved();
|
|
919
|
+
dirty = true;
|
|
920
|
+
wake();
|
|
921
|
+
break;
|
|
922
|
+
case 'backdrop-scroll':
|
|
923
|
+
if (Backdrop.for(owner).setScroll(request.id, request.x, request.y)) {
|
|
924
|
+
appRegions.backdropMoved();
|
|
925
|
+
dirty = true;
|
|
926
|
+
wake();
|
|
927
|
+
}
|
|
928
|
+
break;
|
|
929
|
+
case 'backdrop-edges':
|
|
930
|
+
if (Backdrop.for(owner).setEdges(request.edges)) {
|
|
931
|
+
appRegions.backdropMoved();
|
|
932
|
+
dirty = true;
|
|
933
|
+
wake();
|
|
934
|
+
}
|
|
935
|
+
break;
|
|
936
|
+
case 'capability':
|
|
937
|
+
frameProbe.useDevice(await owner.ready());
|
|
938
|
+
value = { backend: 'webgpu', timestampQuery: frameProbe.timestampQuery };
|
|
939
|
+
break;
|
|
940
|
+
case 'init':
|
|
941
|
+
if (request.appearance !== 'light' && request.appearance !== 'dark')
|
|
942
|
+
throw Error('Glass initialization requires a presented appearance');
|
|
943
|
+
presentationLeadMs = request.presentationLeadMs ?? 0;
|
|
944
|
+
if (!Number.isFinite(presentationLeadMs) ||
|
|
945
|
+
presentationLeadMs < 0 ||
|
|
946
|
+
presentationLeadMs > 50)
|
|
947
|
+
throw Error('Experimental glass presentation lead must be between 0 and 50 ms');
|
|
948
|
+
await appRegions.request({
|
|
949
|
+
type: 'appearance',
|
|
950
|
+
value: request.appearance,
|
|
951
|
+
reducedMotion: false,
|
|
952
|
+
});
|
|
953
|
+
await raster.init(request.canvas, owner, {
|
|
954
|
+
id: 'chrome',
|
|
955
|
+
depth: 0,
|
|
956
|
+
attachment: { kind: 'fixed' },
|
|
957
|
+
});
|
|
958
|
+
value = { ready: true, backend: 'webgpu' };
|
|
959
|
+
break;
|
|
960
|
+
case 'source-images': {
|
|
961
|
+
if (request.revision < sharedRevision) {
|
|
962
|
+
for (const { image } of request.images)
|
|
963
|
+
image?.close();
|
|
964
|
+
value = { superseded: true };
|
|
965
|
+
break;
|
|
966
|
+
}
|
|
967
|
+
sharedRevision = request.revision;
|
|
968
|
+
// Only a backdrop capture replaces the source paired with live region geometry.
|
|
969
|
+
// Navigation atlas uploads and cache eviction share this transport, but do not
|
|
970
|
+
// publish a new backdrop scene revision on the page.
|
|
971
|
+
if (request.backdrop)
|
|
972
|
+
appRegions.beginSourceChange(request.revision);
|
|
973
|
+
const graph = FrameGraph.for(owner);
|
|
974
|
+
// Kept before any slot is replaced: an image is alive only while something holds it.
|
|
975
|
+
for (const key of request.keep ?? []) {
|
|
976
|
+
const kept = keptImages.get(key);
|
|
977
|
+
const image = kept?.image ?? graph.retain(key);
|
|
978
|
+
// Taken anew every time the ink is kept: a lease from before a device loss holds a
|
|
979
|
+
// texture of the lost device (never handed out again, see FrameGraph.target), and
|
|
980
|
+
// would not keep alive the texture the ink was uploaded to since.
|
|
981
|
+
const texture = graph.target('glyphs', image.value.width, image.value.height, false, key);
|
|
982
|
+
kept?.texture.release();
|
|
983
|
+
keptImages.set(key, { image, texture });
|
|
984
|
+
}
|
|
985
|
+
for (const [index, { slot, key, image }] of request.images.entries()) {
|
|
986
|
+
let lease;
|
|
987
|
+
try {
|
|
988
|
+
// Without an image the slot takes a kept one again (no capture, no upload).
|
|
989
|
+
lease = image ? graph.image(key, image) : graph.retain(key);
|
|
990
|
+
}
|
|
991
|
+
catch (error) {
|
|
992
|
+
for (const rest of request.images.slice(index + 1))
|
|
993
|
+
rest.image?.close();
|
|
994
|
+
throw error;
|
|
995
|
+
}
|
|
996
|
+
releaseSlot(slot);
|
|
997
|
+
shared.set(slot, lease);
|
|
998
|
+
}
|
|
999
|
+
for (const key of request.unkeep ?? []) {
|
|
1000
|
+
const kept = keptImages.get(key);
|
|
1001
|
+
kept?.texture.release();
|
|
1002
|
+
kept?.image.release();
|
|
1003
|
+
keptImages.delete(key);
|
|
1004
|
+
}
|
|
1005
|
+
// A plane leaving the set (a route covered by a push) can stay resident, image and texture,
|
|
1006
|
+
// so a pop back to it composes from its capture instead of re-rasterizing and re-uploading.
|
|
1007
|
+
for (const key of request.retain ?? [])
|
|
1008
|
+
if (!retainedPlanes.has(key)) {
|
|
1009
|
+
const image = graph.retain(key);
|
|
1010
|
+
retainedPlanes.set(key, {
|
|
1011
|
+
image,
|
|
1012
|
+
texture: graph.target('front', image.value.width, image.value.height, false, key),
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
for (const { slot, key } of request.restore ?? []) {
|
|
1016
|
+
const retained = retainedPlanes.get(key);
|
|
1017
|
+
if (!retained)
|
|
1018
|
+
throw Error('Retained glass plane is not resident: ' + key);
|
|
1019
|
+
releaseSlot(slot);
|
|
1020
|
+
shared.set(slot, retained.image);
|
|
1021
|
+
slotTextures.set(slot, retained.texture);
|
|
1022
|
+
retainedPlanes.delete(key);
|
|
1023
|
+
}
|
|
1024
|
+
if (request.removePinned?.length) {
|
|
1025
|
+
Backdrop.for(owner).removePinned(request.removePinned);
|
|
1026
|
+
appRegions.backdropMoved();
|
|
1027
|
+
dirty = true;
|
|
1028
|
+
}
|
|
1029
|
+
for (const slot of request.release ?? [])
|
|
1030
|
+
releaseSlot(slot);
|
|
1031
|
+
// Planes retain their images before any slot above is released by a later batch.
|
|
1032
|
+
if (request.layers) {
|
|
1033
|
+
// Regions of unselected tabs take their last frame over their own backdrop first;
|
|
1034
|
+
// the selected tab's regions resume once its planes are installed.
|
|
1035
|
+
if (request.suspendedRegions)
|
|
1036
|
+
appRegions.holdForBackdropChange(request.suspendedRegions);
|
|
1037
|
+
Backdrop.for(owner).setLayers(request.layers);
|
|
1038
|
+
if (request.suspendedRegions)
|
|
1039
|
+
appRegions.resumeForBackdropChange(request.suspendedRegions);
|
|
1040
|
+
if (request.edges)
|
|
1041
|
+
Backdrop.for(owner).setEdges(request.edges);
|
|
1042
|
+
appRegions.backdropMoved();
|
|
1043
|
+
dirty = true;
|
|
1044
|
+
}
|
|
1045
|
+
for (const key of request.unretain ?? []) {
|
|
1046
|
+
const retained = retainedPlanes.get(key);
|
|
1047
|
+
retained?.texture.release();
|
|
1048
|
+
retained?.image.release();
|
|
1049
|
+
retainedPlanes.delete(key);
|
|
1050
|
+
}
|
|
1051
|
+
const backdrop = request.backdrop;
|
|
1052
|
+
if (backdrop && !backdrop.regions) {
|
|
1053
|
+
if (appRegions.sharedRevision !== undefined)
|
|
1054
|
+
await appRegions.request({ type: 'release-source', id: 'root-backdrop' });
|
|
1055
|
+
}
|
|
1056
|
+
else if (backdrop) {
|
|
1057
|
+
await appRegions.request({
|
|
1058
|
+
type: 'appearance',
|
|
1059
|
+
value: backdrop.appearance,
|
|
1060
|
+
reducedMotion: backdrop.reducedMotion,
|
|
1061
|
+
});
|
|
1062
|
+
if (appRegions.sharedRevision !== backdrop.revision || appRegions.navigationActive) {
|
|
1063
|
+
const bitmap = sharedImage(backdrop.key);
|
|
1064
|
+
await appRegions.shareSource({
|
|
1065
|
+
id: 'root-backdrop',
|
|
1066
|
+
revision: backdrop.revision,
|
|
1067
|
+
layerId: 'chrome',
|
|
1068
|
+
role: 'transmitted-backdrop',
|
|
1069
|
+
origin: { x: 0, y: 0 },
|
|
1070
|
+
width: bitmap.width / backdrop.resolution,
|
|
1071
|
+
height: bitmap.height / backdrop.resolution,
|
|
1072
|
+
resolution: backdrop.resolution,
|
|
1073
|
+
}, bitmap, backdrop.key, true);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
// A resumed region whose root capture did not change is installed here.
|
|
1077
|
+
if (request.layers && request.suspendedRegions)
|
|
1078
|
+
await appRegions.installPending();
|
|
1079
|
+
value = { slots: [...shared.keys()] };
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
case 'source': {
|
|
1083
|
+
if (superseded(request.revision) ||
|
|
1084
|
+
(request.revision !== undefined && request.revision < sourceRevision)) {
|
|
1085
|
+
closeImages(request);
|
|
1086
|
+
value = { superseded: true };
|
|
1087
|
+
break;
|
|
1088
|
+
}
|
|
1089
|
+
sourceRevision = request.revision ?? sourceRevision + 1;
|
|
1090
|
+
const [front, rear, glyphs] = images(request);
|
|
1091
|
+
cancel();
|
|
1092
|
+
plan = undefined;
|
|
1093
|
+
x = 0;
|
|
1094
|
+
const at = epochNow(), start = performance.now();
|
|
1095
|
+
raster.install(request.setup, front, rear, glyphs, false);
|
|
1096
|
+
if (tab.active)
|
|
1097
|
+
presentTabSelection();
|
|
1098
|
+
if (request.settle !== false) {
|
|
1099
|
+
render(x);
|
|
1100
|
+
await raster.settled();
|
|
1101
|
+
}
|
|
1102
|
+
else
|
|
1103
|
+
dirty = true;
|
|
1104
|
+
if (!firstPresent && visible) {
|
|
1105
|
+
firstPresent = true;
|
|
1106
|
+
glassTiming('first-present-complete');
|
|
1107
|
+
setTimeout(prewarm, 1000);
|
|
1108
|
+
}
|
|
1109
|
+
wake();
|
|
1110
|
+
value = {
|
|
1111
|
+
receivedAfterMs: at - request.sentAt,
|
|
1112
|
+
installMs: performance.now() - start,
|
|
1113
|
+
...raster.report(),
|
|
1114
|
+
};
|
|
1115
|
+
break;
|
|
1116
|
+
}
|
|
1117
|
+
case 'cover-layer':
|
|
1118
|
+
if (!layers.has(request.layerId))
|
|
1119
|
+
throw Error('Unknown glass layer');
|
|
1120
|
+
if (request.covered)
|
|
1121
|
+
covered.add(request.layerId);
|
|
1122
|
+
else
|
|
1123
|
+
covered.delete(request.layerId);
|
|
1124
|
+
layers.get(request.layerId).setCovered(request.covered);
|
|
1125
|
+
for (const scene of regions.get(request.layerId)?.values() ?? [])
|
|
1126
|
+
scene.setCovered(request.covered);
|
|
1127
|
+
if (!request.covered)
|
|
1128
|
+
render(x);
|
|
1129
|
+
cancel();
|
|
1130
|
+
wake();
|
|
1131
|
+
value = { covered: [...covered] };
|
|
1132
|
+
break;
|
|
1133
|
+
case 'detach-layer': {
|
|
1134
|
+
if (request.layerId === 'menu-lift' || request.layerId === 'menu')
|
|
1135
|
+
menuInput.clear();
|
|
1136
|
+
if (request.layerId === 'chrome' && !request.regionId)
|
|
1137
|
+
throw Error('Cannot detach root layer');
|
|
1138
|
+
const list = regions.get(request.layerId);
|
|
1139
|
+
if (request.regionId) {
|
|
1140
|
+
list?.get(request.regionId)?.dispose();
|
|
1141
|
+
list?.delete(request.regionId);
|
|
1142
|
+
}
|
|
1143
|
+
else {
|
|
1144
|
+
layers.get(request.layerId)?.dispose();
|
|
1145
|
+
layers.delete(request.layerId);
|
|
1146
|
+
for (const scene of list?.values() ?? [])
|
|
1147
|
+
scene.dispose();
|
|
1148
|
+
regions.delete(request.layerId);
|
|
1149
|
+
owner.detach(request.layerId);
|
|
1150
|
+
}
|
|
1151
|
+
render(x);
|
|
1152
|
+
value = owner.report();
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
case 'layer-viewport': {
|
|
1156
|
+
const scene = layers.get(request.layerId);
|
|
1157
|
+
if (!scene)
|
|
1158
|
+
throw Error('Unknown glass layer ' + request.layerId);
|
|
1159
|
+
scene.setCanvasViewport(request.viewport);
|
|
1160
|
+
value = { viewport: request.viewport };
|
|
1161
|
+
break;
|
|
1162
|
+
}
|
|
1163
|
+
case 'attach-layer': {
|
|
1164
|
+
if (layers.has(request.layer.id))
|
|
1165
|
+
throw Error('Duplicate layer');
|
|
1166
|
+
const scene = new WebGPURaster();
|
|
1167
|
+
scene.setSubmissionGate(submissionAllowed);
|
|
1168
|
+
await scene.init(request.canvas, owner, request.layer);
|
|
1169
|
+
layers.set(request.layer.id, scene);
|
|
1170
|
+
value = owner.report();
|
|
1171
|
+
break;
|
|
1172
|
+
}
|
|
1173
|
+
case 'layer-source': {
|
|
1174
|
+
if (superseded(request.revision)) {
|
|
1175
|
+
closeImages(request);
|
|
1176
|
+
value = { superseded: true };
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
let scene = layers.get(request.layerId);
|
|
1180
|
+
if (!scene)
|
|
1181
|
+
throw Error('Unknown layer');
|
|
1182
|
+
if (request.regionId) {
|
|
1183
|
+
const list = regions.get(request.layerId) ?? new Map();
|
|
1184
|
+
const region = list.get(request.regionId) ?? scene.forkRegion();
|
|
1185
|
+
list.set(request.regionId, region);
|
|
1186
|
+
regions.set(request.layerId, list);
|
|
1187
|
+
scene = region;
|
|
1188
|
+
}
|
|
1189
|
+
scene.setCovered(covered.has(request.layerId));
|
|
1190
|
+
const [front, rear, glyphs] = images(request);
|
|
1191
|
+
scene.install(request.setup, front, rear, glyphs, false);
|
|
1192
|
+
if (request.layerId === 'chrome-lift' && tab.active)
|
|
1193
|
+
presentTabSelection();
|
|
1194
|
+
if (request.settle !== false) {
|
|
1195
|
+
render(x);
|
|
1196
|
+
await scene.settled();
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
dirty = true;
|
|
1200
|
+
wake();
|
|
1201
|
+
}
|
|
1202
|
+
if (!firstPresent && visible && !request.setup.liftOverlay) {
|
|
1203
|
+
firstPresent = true;
|
|
1204
|
+
glassTiming('first-present-complete');
|
|
1205
|
+
setTimeout(prewarm, 1000);
|
|
1206
|
+
}
|
|
1207
|
+
menuInput.sourceInstalled();
|
|
1208
|
+
value = scene.report();
|
|
1209
|
+
break;
|
|
1210
|
+
}
|
|
1211
|
+
case 'run':
|
|
1212
|
+
validateTrack(request.plan);
|
|
1213
|
+
if (request.plan.sourceRevision !== undefined &&
|
|
1214
|
+
request.plan.sourceRevision !== sourceRevision)
|
|
1215
|
+
throw Error('Motion source revision is not installed');
|
|
1216
|
+
cancel();
|
|
1217
|
+
frames = [];
|
|
1218
|
+
previous = undefined;
|
|
1219
|
+
plan = request.plan;
|
|
1220
|
+
x = plan.from;
|
|
1221
|
+
inputAt = plan.epoch;
|
|
1222
|
+
wake();
|
|
1223
|
+
value = { started: true };
|
|
1224
|
+
break;
|
|
1225
|
+
case 'pose':
|
|
1226
|
+
if (request.at >= inputAt) {
|
|
1227
|
+
x = request.x;
|
|
1228
|
+
inputAt = request.at;
|
|
1229
|
+
}
|
|
1230
|
+
break;
|
|
1231
|
+
case 'benchmark':
|
|
1232
|
+
cancel();
|
|
1233
|
+
plan = undefined;
|
|
1234
|
+
value = await raster.benchmark();
|
|
1235
|
+
break;
|
|
1236
|
+
case 'stage':
|
|
1237
|
+
if (dirty) {
|
|
1238
|
+
dirty = false;
|
|
1239
|
+
render(x);
|
|
1240
|
+
}
|
|
1241
|
+
value = await raster.stageSnapshot(request.stage, request.level);
|
|
1242
|
+
break;
|
|
1243
|
+
case 'snapshot': {
|
|
1244
|
+
if (dirty) {
|
|
1245
|
+
dirty = false;
|
|
1246
|
+
render(x);
|
|
1247
|
+
}
|
|
1248
|
+
const scene = layers.get(request.layerId ?? 'chrome');
|
|
1249
|
+
if (!scene) {
|
|
1250
|
+
value = await appRegions.snapshot(request.layerId);
|
|
1251
|
+
break;
|
|
1252
|
+
}
|
|
1253
|
+
if (request.x !== undefined)
|
|
1254
|
+
scene.draw(request.x);
|
|
1255
|
+
value = await scene.snapshot();
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
case 'report':
|
|
1259
|
+
value = {
|
|
1260
|
+
executionThread: typeof document === 'undefined' ? 'worker' : 'main',
|
|
1261
|
+
shading: [
|
|
1262
|
+
raster,
|
|
1263
|
+
...layers.values(),
|
|
1264
|
+
...[...regions.values()].flatMap(list => [...list.values()]),
|
|
1265
|
+
]
|
|
1266
|
+
.filter((r, i, a) => a.indexOf(r) === i)
|
|
1267
|
+
.reduce((n, r) => ({
|
|
1268
|
+
presentPixels: n.presentPixels + r.stats.presentPixels,
|
|
1269
|
+
presentAttachmentPixels: n.presentAttachmentPixels + r.stats.presentAttachmentPixels,
|
|
1270
|
+
draws: n.draws + r.stats.draws,
|
|
1271
|
+
}), { presentPixels: 0, presentAttachmentPixels: 0, draws: 0 }),
|
|
1272
|
+
interactive: {
|
|
1273
|
+
tab: {
|
|
1274
|
+
timing: tabTiming,
|
|
1275
|
+
active: tab.active,
|
|
1276
|
+
pending: tab.needsFrame,
|
|
1277
|
+
amount: tab.lensMix,
|
|
1278
|
+
capsule: tab.capsule(),
|
|
1279
|
+
optics: tab.optics(),
|
|
1280
|
+
spec: raster.spec,
|
|
1281
|
+
},
|
|
1282
|
+
menu: {
|
|
1283
|
+
active: menuLift.active,
|
|
1284
|
+
pending: menuLift.needsFrame,
|
|
1285
|
+
amount: menuLift.lensMix,
|
|
1286
|
+
},
|
|
1287
|
+
},
|
|
1288
|
+
appRegions: appRegions.diagnostics(),
|
|
1289
|
+
...raster.report(),
|
|
1290
|
+
frames,
|
|
1291
|
+
callbacks,
|
|
1292
|
+
framePending: !!handle,
|
|
1293
|
+
rate: 60,
|
|
1294
|
+
clock: 'page-raf',
|
|
1295
|
+
visible,
|
|
1296
|
+
presentationGate: {
|
|
1297
|
+
allowed: submissionAllowed(),
|
|
1298
|
+
presentationEpoch,
|
|
1299
|
+
hideEpoch,
|
|
1300
|
+
appearanceRefreshPending,
|
|
1301
|
+
appearanceInstallRevision,
|
|
1302
|
+
appearanceInstallHideEpoch,
|
|
1303
|
+
deviceAppearanceRevision,
|
|
1304
|
+
lost,
|
|
1305
|
+
},
|
|
1306
|
+
sourceRevision,
|
|
1307
|
+
covered: [...covered],
|
|
1308
|
+
regions: [...regions.entries()].map(([layer, list]) => ({
|
|
1309
|
+
layer,
|
|
1310
|
+
ids: [...list.keys()],
|
|
1311
|
+
})),
|
|
1312
|
+
layerReports: [...layers.entries()].map(([id, scene]) => ({ id, ...scene.report() })),
|
|
1313
|
+
regionInteractions: appRegions.diagnostics().interactions,
|
|
1314
|
+
regionPresenters: appRegions.diagnostics().presenterOrigins,
|
|
1315
|
+
regionPoses: appRegions.diagnostics().regionPoses,
|
|
1316
|
+
backdropPlanes: Backdrop.for(owner).report(),
|
|
1317
|
+
lagTrace: lagTraceEnabled() ? exportLagTrace() : undefined,
|
|
1318
|
+
loop: {
|
|
1319
|
+
handle: !!handle,
|
|
1320
|
+
looping,
|
|
1321
|
+
visible,
|
|
1322
|
+
lost,
|
|
1323
|
+
tracks: [...tracks].map(([id, t]) => [
|
|
1324
|
+
id,
|
|
1325
|
+
Math.round(epochNow() - t.epoch),
|
|
1326
|
+
t.duration,
|
|
1327
|
+
]),
|
|
1328
|
+
covered: [...covered],
|
|
1329
|
+
},
|
|
1330
|
+
presentations: [...layers.entries()].map(([id, scene]) => ({
|
|
1331
|
+
layer: id,
|
|
1332
|
+
surfaces: [scene, ...(regions.get(id)?.values() ?? [])]
|
|
1333
|
+
.map(surface => surface.presentation())
|
|
1334
|
+
.filter(Boolean),
|
|
1335
|
+
})),
|
|
1336
|
+
backdrop: Backdrop.for(owner).report(),
|
|
1337
|
+
};
|
|
1338
|
+
break;
|
|
1339
|
+
case 'visible': {
|
|
1340
|
+
// A second foreground notification can arrive after the user has already
|
|
1341
|
+
// pressed a control or started a presentation. Keep that input and motion,
|
|
1342
|
+
// and let its new source work proceed without another restore ahead of it.
|
|
1343
|
+
// A changed appearance, hide epoch or lost device still takes the full path.
|
|
1344
|
+
if (request.visible &&
|
|
1345
|
+
visible &&
|
|
1346
|
+
!lost &&
|
|
1347
|
+
!appearanceRefreshPending &&
|
|
1348
|
+
presentationEpoch === receivedHideEpoch &&
|
|
1349
|
+
receivedHideEpoch === hideEpoch &&
|
|
1350
|
+
restoredAppearance &&
|
|
1351
|
+
receivedAppearance === restoredAppearance &&
|
|
1352
|
+
request.appearance === restoredAppearance.value &&
|
|
1353
|
+
(request.reducedMotion ?? false) === restoredAppearance.reducedMotion) {
|
|
1354
|
+
if (lagTraceEnabled())
|
|
1355
|
+
glassTiming('resume-already-restored');
|
|
1356
|
+
value = { visible };
|
|
1357
|
+
break;
|
|
1358
|
+
}
|
|
1359
|
+
cancel();
|
|
1360
|
+
dirty = false;
|
|
1361
|
+
plan = undefined;
|
|
1362
|
+
// A track ends at its target here, as the page's own run does when it hides
|
|
1363
|
+
// (production.ts, handleVisibility): dropped at its last sample, the tab bar kept a
|
|
1364
|
+
// mid-morph shape (a Search member half out) until the next source install.
|
|
1365
|
+
for (const [id, track] of tracks)
|
|
1366
|
+
regionById(id)?.updateSpec(track.specs.at(-1));
|
|
1367
|
+
tracks.clear();
|
|
1368
|
+
navigationTrack = undefined;
|
|
1369
|
+
menuInput.clear();
|
|
1370
|
+
const scenes = [
|
|
1371
|
+
...layers.values(),
|
|
1372
|
+
...[...regions.values()].flatMap(list => [...list.values()]),
|
|
1373
|
+
];
|
|
1374
|
+
if (!request.visible) {
|
|
1375
|
+
visible = false;
|
|
1376
|
+
for (const scene of scenes)
|
|
1377
|
+
scene.setVisible(false);
|
|
1378
|
+
Backdrop.for(owner).suspend();
|
|
1379
|
+
await appRegions.request({ type: 'visibility', visible: false });
|
|
1380
|
+
tab.reset(tab.selected);
|
|
1381
|
+
menuLift.reset(0);
|
|
1382
|
+
for (const surface of [layers.get('chrome-lift'), menuLiftRaster()])
|
|
1383
|
+
if (surface?.spec)
|
|
1384
|
+
surface.setLift({ amount: 0, source: 'transmissive', optics: tab.optics() });
|
|
1385
|
+
}
|
|
1386
|
+
else {
|
|
1387
|
+
try {
|
|
1388
|
+
if (request.appearance !== 'light' && request.appearance !== 'dark')
|
|
1389
|
+
throw Error('Glass resume requires a current presented appearance');
|
|
1390
|
+
await owner.ready();
|
|
1391
|
+
if (receivedHideEpoch !== hideEpoch)
|
|
1392
|
+
break;
|
|
1393
|
+
// Appearance arrivals bypass the serialized GPU wait. Retint retained
|
|
1394
|
+
// sources again if the page store changes before the first submission.
|
|
1395
|
+
while (receivedHideEpoch === hideEpoch) {
|
|
1396
|
+
const appearance = receivedAppearance;
|
|
1397
|
+
for (const scene of scenes) {
|
|
1398
|
+
scene.setVisible(false);
|
|
1399
|
+
scene.setAppearance(appearance.value);
|
|
1400
|
+
}
|
|
1401
|
+
await appRegions.request({
|
|
1402
|
+
type: 'appearance',
|
|
1403
|
+
value: appearance.value,
|
|
1404
|
+
reducedMotion: appearance.reducedMotion,
|
|
1405
|
+
});
|
|
1406
|
+
if (receivedHideEpoch !== hideEpoch)
|
|
1407
|
+
break;
|
|
1408
|
+
for (const scene of scenes)
|
|
1409
|
+
scene.setVisible(true, true);
|
|
1410
|
+
await appRegions.prepareResume();
|
|
1411
|
+
await raster.settled();
|
|
1412
|
+
if (appearance === receivedAppearance)
|
|
1413
|
+
break;
|
|
1414
|
+
}
|
|
1415
|
+
if (receivedHideEpoch !== hideEpoch) {
|
|
1416
|
+
for (const scene of scenes)
|
|
1417
|
+
scene.setVisible(false);
|
|
1418
|
+
await appRegions.request({ type: 'visibility', visible: false });
|
|
1419
|
+
break;
|
|
1420
|
+
}
|
|
1421
|
+
appearanceRefreshPending = false;
|
|
1422
|
+
presentationEpoch = receivedHideEpoch;
|
|
1423
|
+
restoredAppearance = receivedAppearance;
|
|
1424
|
+
visible = true;
|
|
1425
|
+
appRegions.present();
|
|
1426
|
+
render(x);
|
|
1427
|
+
await raster.settled();
|
|
1428
|
+
}
|
|
1429
|
+
catch (error) {
|
|
1430
|
+
visible = false;
|
|
1431
|
+
for (const scene of scenes)
|
|
1432
|
+
scene.setVisible(false);
|
|
1433
|
+
await appRegions.request({ type: 'visibility', visible: false });
|
|
1434
|
+
throw error;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
value = { visible };
|
|
1438
|
+
break;
|
|
1439
|
+
}
|
|
1440
|
+
case 'force-null-adapters':
|
|
1441
|
+
owner.forceNullAdaptersForTest(request.attempts);
|
|
1442
|
+
raster.loseDevice();
|
|
1443
|
+
value = { requested: true };
|
|
1444
|
+
break;
|
|
1445
|
+
case 'lose-context':
|
|
1446
|
+
raster.loseDevice();
|
|
1447
|
+
value = { requested: true };
|
|
1448
|
+
break;
|
|
1449
|
+
case 'restore-context':
|
|
1450
|
+
value = { automatic: true };
|
|
1451
|
+
break;
|
|
1452
|
+
}
|
|
1453
|
+
if (profiled)
|
|
1454
|
+
glassTiming('worker-request', started, request.type === 'canonical' ? 'canonical:' + request.request.type : request.type);
|
|
1455
|
+
if (requestMark)
|
|
1456
|
+
requestMark.ms = glassNow() - started;
|
|
1457
|
+
if (adapterRecoveryReady && !appearanceRefreshPending) {
|
|
1458
|
+
adapterRecoveryReady = false;
|
|
1459
|
+
emit({ adapterRecovery: false });
|
|
1460
|
+
}
|
|
1461
|
+
publishPresentationGate();
|
|
1462
|
+
if (id)
|
|
1463
|
+
emit({ id, value });
|
|
1464
|
+
})
|
|
1465
|
+
.catch(error => {
|
|
1466
|
+
reportError(request.type, error);
|
|
1467
|
+
if (id)
|
|
1468
|
+
emit({ id, error: String(error) });
|
|
1469
|
+
});
|
|
1470
|
+
};
|
|
1471
|
+
return {
|
|
1472
|
+
receive,
|
|
1473
|
+
stop: () => {
|
|
1474
|
+
owner.stop();
|
|
1475
|
+
cancel();
|
|
1476
|
+
},
|
|
1477
|
+
};
|
|
1478
|
+
}
|