@weasel-js/core 1.7.0 → 1.7.1
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/CHANGELOG.md +764 -0
- package/README.md +7 -8
- package/dist/WeaselProvider.js +15 -0
- package/dist/WeaselProvider.js.map +1 -0
- package/dist/affordances/composeAffordanceLayer.js +224 -0
- package/dist/affordances/composeAffordanceLayer.js.map +1 -0
- package/dist/affordances/cornerResize.js +69 -0
- package/dist/affordances/cornerResize.js.map +1 -0
- package/dist/affordances/hitAffordanceRegions.js +138 -0
- package/dist/affordances/hitAffordanceRegions.js.map +1 -0
- package/dist/affordances/pathAnchors.js +66 -0
- package/dist/affordances/pathAnchors.js.map +1 -0
- package/dist/affordances/rotationHandle.js +103 -0
- package/dist/affordances/rotationHandle.js.map +1 -0
- package/dist/animation/behaviors/momentum.js +118 -0
- package/dist/animation/behaviors/momentum.js.map +1 -0
- package/dist/animation/colorHelpers.js +135 -0
- package/dist/animation/colorHelpers.js.map +1 -0
- package/dist/animation/colorRegistry.js +37 -0
- package/dist/animation/colorRegistry.js.map +1 -0
- package/dist/animation/index.js +20 -0
- package/dist/animation/loop.js +62 -0
- package/dist/animation/loop.js.map +1 -0
- package/dist/animation/observe.js +23 -0
- package/dist/animation/observe.js.map +1 -0
- package/dist/animation/poseHelpers.js +50 -0
- package/dist/animation/poseHelpers.js.map +1 -0
- package/dist/animation/reflow.js +121 -0
- package/dist/animation/reflow.js.map +1 -0
- package/dist/animation/rig/bindRig.js +74 -0
- package/dist/animation/rig/bindRig.js.map +1 -0
- package/dist/animation/rig/blendPoses.js +43 -0
- package/dist/animation/rig/blendPoses.js.map +1 -0
- package/dist/animation/rig/mirrorPose.js +19 -0
- package/dist/animation/rig/mirrorPose.js.map +1 -0
- package/dist/animation/rig/resolveSkeleton.js +33 -0
- package/dist/animation/rig/resolveSkeleton.js.map +1 -0
- package/dist/animation/rig/solveIk.js +103 -0
- package/dist/animation/rig/solveIk.js.map +1 -0
- package/dist/animation/rig/types.js +12 -0
- package/dist/animation/rig/types.js.map +1 -0
- package/dist/animation/rig/useRig.js +23 -0
- package/dist/animation/rig/useRig.js.map +1 -0
- package/dist/animation/slew.js +27 -0
- package/dist/animation/slew.js.map +1 -0
- package/dist/animation/stagger.js +138 -0
- package/dist/animation/stagger.js.map +1 -0
- package/dist/animation/timeline/booking.js +106 -0
- package/dist/animation/timeline/booking.js.map +1 -0
- package/dist/animation/timeline/createTimeline.js +116 -0
- package/dist/animation/timeline/createTimeline.js.map +1 -0
- package/dist/animation/timeline/sampleTrack.js +29 -0
- package/dist/animation/timeline/sampleTrack.js.map +1 -0
- package/dist/animation/useAnimator.js +329 -0
- package/dist/animation/useAnimator.js.map +1 -0
- package/dist/animation/wrappers/animateLifecycle.js +40 -0
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -0
- package/dist/animation/wrappers/animateOnSetPose.js +44 -0
- package/dist/animation/wrappers/animateOnSetPose.js.map +1 -0
- package/dist/{autoPoseDescriptor-_XOyF7t4.d.ts → autoPoseDescriptor-BT_vp9FO.d.ts} +2 -2
- package/dist/{builtins-DLn2lCr_.d.ts → builtins-BSUfH8nU.d.ts} +738 -513
- package/dist/canvas/Canvas.js +608 -0
- package/dist/canvas/Canvas.js.map +1 -0
- package/dist/canvas/CanvasView.js +255 -0
- package/dist/canvas/CanvasView.js.map +1 -0
- package/dist/canvas/CursorCoordsHud.js +75 -0
- package/dist/canvas/CursorCoordsHud.js.map +1 -0
- package/dist/canvas/DrawCanvas.js +67 -0
- package/dist/canvas/DrawCanvas.js.map +1 -0
- package/dist/canvas/MinimapCanvas.js +139 -0
- package/dist/canvas/MinimapCanvas.js.map +1 -0
- package/dist/canvas/ModalityHud.js +66 -0
- package/dist/canvas/ModalityHud.js.map +1 -0
- package/dist/canvas/NodeShape.js +391 -0
- package/dist/canvas/NodeShape.js.map +1 -0
- package/dist/canvas/PickHud.js +93 -0
- package/dist/canvas/PickHud.js.map +1 -0
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +10 -0
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +10 -0
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +51 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/contributionFrameHooks.js +42 -0
- package/dist/canvas/SceneCanvas/contributionFrameHooks.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +549 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +26 -0
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -0
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +69 -0
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -0
- package/dist/canvas/SceneCanvas/features.js +97 -0
- package/dist/canvas/SceneCanvas/features.js.map +1 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js +46 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +48 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -0
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +70 -0
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useContributionRoles.js +75 -0
- package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +172 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +69 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +127 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js +30 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -0
- package/dist/canvas/SceneCanvas.js +992 -0
- package/dist/canvas/SceneCanvas.js.map +1 -0
- package/dist/canvas/SceneViewCanvas.js +54 -0
- package/dist/canvas/SceneViewCanvas.js.map +1 -0
- package/dist/canvas/accentColor.js +9 -0
- package/dist/canvas/accentColor.js.map +1 -0
- package/dist/canvas/affordanceAt.js +63 -0
- package/dist/canvas/affordanceAt.js.map +1 -0
- package/dist/canvas/buildSceneTree.js +65 -0
- package/dist/canvas/buildSceneTree.js.map +1 -0
- package/dist/canvas/canvasRenderer.js +89 -0
- package/dist/canvas/canvasRenderer.js.map +1 -0
- package/dist/canvas/colorOverrides.js +16 -0
- package/dist/canvas/colorOverrides.js.map +1 -0
- package/dist/canvas/defaultDrawOne.js +43 -0
- package/dist/canvas/defaultDrawOne.js.map +1 -0
- package/dist/canvas/deps/areaSelect.js +19 -0
- package/dist/canvas/deps/areaSelect.js.map +1 -0
- package/dist/canvas/deps/debug.js +9 -0
- package/dist/canvas/deps/debug.js.map +1 -0
- package/dist/canvas/deps/dispatcher.js +11 -0
- package/dist/canvas/deps/dispatcher.js.map +1 -0
- package/dist/canvas/deps/editAnchors.js +101 -0
- package/dist/canvas/deps/editAnchors.js.map +1 -0
- package/dist/canvas/deps/geometryProjection.js +11 -0
- package/dist/canvas/deps/geometryProjection.js.map +1 -0
- package/dist/canvas/deps/hitTestArea.js +51 -0
- package/dist/canvas/deps/hitTestArea.js.map +1 -0
- package/dist/canvas/deps/ingestion.js +31 -0
- package/dist/canvas/deps/ingestion.js.map +1 -0
- package/dist/canvas/deps/insert.js +116 -0
- package/dist/canvas/deps/insert.js.map +1 -0
- package/dist/canvas/deps/lassoSelect.js +20 -0
- package/dist/canvas/deps/lassoSelect.js.map +1 -0
- package/dist/canvas/deps/layout.js +34 -0
- package/dist/canvas/deps/layout.js.map +1 -0
- package/dist/canvas/deps/nodeAtPoint.js +19 -0
- package/dist/canvas/deps/nodeAtPoint.js.map +1 -0
- package/dist/canvas/deps/poseComposition.js +11 -0
- package/dist/canvas/deps/poseComposition.js.map +1 -0
- package/dist/canvas/deps/poseDescriptor.js +12 -0
- package/dist/canvas/deps/poseDescriptor.js.map +1 -0
- package/dist/canvas/deps/resizePolicy.js +35 -0
- package/dist/canvas/deps/resizePolicy.js.map +1 -0
- package/dist/canvas/deps/slice.js +99 -0
- package/dist/canvas/deps/slice.js.map +1 -0
- package/dist/canvas/deps/snap.js +11 -0
- package/dist/canvas/deps/snap.js.map +1 -0
- package/dist/canvas/deps/textEdit.js +21 -0
- package/dist/canvas/deps/textEdit.js.map +1 -0
- package/dist/canvas/deps/view.js +43 -0
- package/dist/canvas/deps/view.js.map +1 -0
- package/dist/canvas/derivedPath.js +47 -0
- package/dist/canvas/derivedPath.js.map +1 -0
- package/dist/canvas/drawEnvelope.js +22 -0
- package/dist/canvas/drawEnvelope.js.map +1 -0
- package/dist/canvas/getNodeAtPoint.js +18 -0
- package/dist/canvas/getNodeAtPoint.js.map +1 -0
- package/dist/canvas/hostAnchor.js +29 -0
- package/dist/canvas/hostAnchor.js.map +1 -0
- package/dist/canvas/hud.module.js +18 -0
- package/dist/canvas/hud.module.js.map +1 -0
- package/dist/canvas/insertPreviewExtent.js +103 -0
- package/dist/canvas/insertPreviewExtent.js.map +1 -0
- package/dist/canvas/kitRequirements.js +177 -0
- package/dist/canvas/kitRequirements.js.map +1 -0
- package/dist/canvas/layerOrder.js +66 -0
- package/dist/canvas/layerOrder.js.map +1 -0
- package/dist/canvas/layerSlots.js +14 -0
- package/dist/canvas/layerSlots.js.map +1 -0
- package/dist/canvas/minimapMath.js +80 -0
- package/dist/canvas/minimapMath.js.map +1 -0
- package/dist/canvas/mountedCanvases.js +20 -0
- package/dist/canvas/mountedCanvases.js.map +1 -0
- package/dist/canvas/overlayRoleStrokes.js +17 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -0
- package/dist/canvas/paintCull.js +20 -0
- package/dist/canvas/paintCull.js.map +1 -0
- package/dist/canvas/pickWalk.js +158 -0
- package/dist/canvas/pickWalk.js.map +1 -0
- package/dist/canvas/planeClips.js +30 -0
- package/dist/canvas/planeClips.js.map +1 -0
- package/dist/canvas/poseRotation.js +35 -0
- package/dist/canvas/poseRotation.js.map +1 -0
- package/dist/canvas/rasterToPng.js +21 -0
- package/dist/canvas/rasterToPng.js.map +1 -0
- package/dist/canvas/renderDebugSnapshot.js +32 -0
- package/dist/canvas/renderDebugSnapshot.js.map +1 -0
- package/dist/canvas/renderNeeds.js +25 -0
- package/dist/canvas/renderNeeds.js.map +1 -0
- package/dist/canvas/renderSceneToPixels.js +143 -0
- package/dist/canvas/renderSceneToPixels.js.map +1 -0
- package/dist/canvas/sceneAdapter.js +270 -0
- package/dist/canvas/sceneAdapter.js.map +1 -0
- package/dist/canvas/sceneLayerPaint.js +37 -0
- package/dist/canvas/sceneLayerPaint.js.map +1 -0
- package/dist/canvas/sceneSlotWiring.js +20 -0
- package/dist/canvas/sceneSlotWiring.js.map +1 -0
- package/dist/canvas/sceneViewRender.js +72 -0
- package/dist/canvas/sceneViewRender.js.map +1 -0
- package/dist/canvas/slopsDebugLayer.js +61 -0
- package/dist/canvas/slopsDebugLayer.js.map +1 -0
- package/dist/canvas/surfaceContribution.js +15 -0
- package/dist/canvas/surfaceContribution.js.map +1 -0
- package/dist/canvas/toolPreview.js +39 -0
- package/dist/canvas/toolPreview.js.map +1 -0
- package/dist/canvas/useCanvasRenderer.js +11 -0
- package/dist/canvas/useCanvasRenderer.js.map +1 -0
- package/dist/canvas/useFrameLoop.js +60 -0
- package/dist/canvas/useFrameLoop.js.map +1 -0
- package/dist/canvas/useHostAnchor.js +71 -0
- package/dist/canvas/useHostAnchor.js.map +1 -0
- package/dist/canvas/useLateContentRedraw.js +21 -0
- package/dist/canvas/useLateContentRedraw.js.map +1 -0
- package/dist/canvas/useRedrawOn.js +21 -0
- package/dist/canvas/useRedrawOn.js.map +1 -0
- package/dist/canvas/useViewHelpers.js +120 -0
- package/dist/canvas/useViewHelpers.js.map +1 -0
- package/dist/canvas/viewInputs.js +17 -0
- package/dist/canvas/viewInputs.js.map +1 -0
- package/dist/canvas/viewRegistry.js +61 -0
- package/dist/canvas/viewRegistry.js.map +1 -0
- package/dist/canvas/wrapNodeOutput.js +14 -0
- package/dist/canvas/wrapNodeOutput.js.map +1 -0
- package/dist/clipboard.d.ts +10 -5
- package/dist/clipboard.js +3 -5
- package/dist/clone.d.ts +3 -3
- package/dist/clone.js +2 -5
- package/dist/core/adapters/arrayAdapter.js +85 -0
- package/dist/core/adapters/arrayAdapter.js.map +1 -0
- package/dist/core/adapters/useArrayAdapter.js +13 -0
- package/dist/core/adapters/useArrayAdapter.js.map +1 -0
- package/dist/core/applyOps.js +12 -0
- package/dist/core/applyOps.js.map +1 -0
- package/dist/core/device/index.js +4 -0
- package/dist/core/device/targets.js +17 -0
- package/dist/core/device/targets.js.map +1 -0
- package/dist/core/device/useDeviceProfile.js +75 -0
- package/dist/core/device/useDeviceProfile.js.map +1 -0
- package/dist/core/fillInPoseFrame.js +102 -0
- package/dist/core/fillInPoseFrame.js.map +1 -0
- package/dist/core/geometry/poseDescriptor.js +98 -0
- package/dist/core/geometry/poseDescriptor.js.map +1 -0
- package/dist/core/geometry/poseRotation.js +58 -0
- package/dist/core/geometry/poseRotation.js.map +1 -0
- package/dist/core/geometry/regionHit.js +102 -0
- package/dist/core/geometry/regionHit.js.map +1 -0
- package/dist/core/geometry/unionBounds.js +60 -0
- package/dist/core/geometry/unionBounds.js.map +1 -0
- package/dist/core/gradient.js +136 -0
- package/dist/core/gradient.js.map +1 -0
- package/dist/core/isPlainObject.js +11 -0
- package/dist/core/isPlainObject.js.map +1 -0
- package/dist/core/layers/render.js +150 -0
- package/dist/core/layers/render.js.map +1 -0
- package/dist/core/markerInset.js +24 -0
- package/dist/core/markerInset.js.map +1 -0
- package/dist/core/mixed.js +6 -0
- package/dist/core/mixed.js.map +1 -0
- package/dist/core/ops/arrange.js +31 -0
- package/dist/core/ops/arrange.js.map +1 -0
- package/dist/core/ops/create.js +32 -0
- package/dist/core/ops/create.js.map +1 -0
- package/dist/core/ops/createHistory.js +20 -0
- package/dist/core/ops/createHistory.js.map +1 -0
- package/dist/core/ops/delete.js +89 -0
- package/dist/core/ops/delete.js.map +1 -0
- package/dist/core/ops/registry.js +17 -0
- package/dist/core/ops/registry.js.map +1 -0
- package/dist/core/ops/reorder/algorithms.js +55 -0
- package/dist/core/ops/reorder/algorithms.js.map +1 -0
- package/dist/core/ops/reorder/index.js +140 -0
- package/dist/core/ops/reorder/index.js.map +1 -0
- package/dist/core/ops/reparent.js +52 -0
- package/dist/core/ops/reparent.js.map +1 -0
- package/dist/core/ops/select.js +34 -0
- package/dist/core/ops/select.js.map +1 -0
- package/dist/core/ops/setData.js +34 -0
- package/dist/core/ops/setData.js.map +1 -0
- package/dist/core/ops/setLayer.js +34 -0
- package/dist/core/ops/setLayer.js.map +1 -0
- package/dist/core/ops/setLayout.js +31 -0
- package/dist/core/ops/setLayout.js.map +1 -0
- package/dist/core/ops/setPath.js +57 -0
- package/dist/core/ops/setPath.js.map +1 -0
- package/dist/core/ops/setText.js +34 -0
- package/dist/core/ops/setText.js.map +1 -0
- package/dist/core/ops/slot.js +37 -0
- package/dist/core/ops/slot.js.map +1 -0
- package/dist/core/ops/transform.js +42 -0
- package/dist/core/ops/transform.js.map +1 -0
- package/dist/core/paintKinds.js +156 -0
- package/dist/core/paintKinds.js.map +1 -0
- package/dist/core/scene/NodeProperties.js +20 -0
- package/dist/core/scene/NodeProperties.js.map +1 -0
- package/dist/core/scene/NodeRouting.js +24 -0
- package/dist/core/scene/NodeRouting.js.map +1 -0
- package/dist/core/scene/arrivals.js +12 -0
- package/dist/core/scene/arrivals.js.map +1 -0
- package/dist/core/scene/composeFrame.js +29 -0
- package/dist/core/scene/composeFrame.js.map +1 -0
- package/dist/core/scene/depMemo.js +18 -0
- package/dist/core/scene/depMemo.js.map +1 -0
- package/dist/core/scene/dependents.js +66 -0
- package/dist/core/scene/dependents.js.map +1 -0
- package/dist/core/scene/derivedPath.js +31 -0
- package/dist/core/scene/derivedPath.js.map +1 -0
- package/dist/core/scene/effectivePose.js +78 -0
- package/dist/core/scene/effectivePose.js.map +1 -0
- package/dist/core/scene/kitRegistry.js +33 -0
- package/dist/core/scene/kitRegistry.js.map +1 -0
- package/dist/core/scene/layoutPass.js +96 -0
- package/dist/core/scene/layoutPass.js.map +1 -0
- package/dist/core/scene/nodeFnFields.js +83 -0
- package/dist/core/scene/nodeFnFields.js.map +1 -0
- package/dist/core/scene/nodeMemo.js +28 -0
- package/dist/core/scene/nodeMemo.js.map +1 -0
- package/dist/core/scene/poseFeed.js +87 -0
- package/dist/core/scene/poseFeed.js.map +1 -0
- package/dist/core/scene/poseOverrides.js +52 -0
- package/dist/core/scene/poseOverrides.js.map +1 -0
- package/dist/core/scene/poseSnapshot.js +54 -0
- package/dist/core/scene/poseSnapshot.js.map +1 -0
- package/dist/core/scene/scene.js +1271 -0
- package/dist/core/scene/scene.js.map +1 -0
- package/dist/core/scene/types.js +6 -0
- package/dist/core/scene/types.js.map +1 -0
- package/dist/core/scene/useScene.js +32 -0
- package/dist/core/scene/useScene.js.map +1 -0
- package/dist/core/selection/chromeState.js +31 -0
- package/dist/core/selection/chromeState.js.map +1 -0
- package/dist/core/selection/selectionTarget.js +6 -0
- package/dist/core/selection/selectionTarget.js.map +1 -0
- package/dist/core/selection/useSelection.js +71 -0
- package/dist/core/selection/useSelection.js.map +1 -0
- package/dist/core/shapeKinds.js +54 -0
- package/dist/core/shapeKinds.js.map +1 -0
- package/dist/core/strokeMarkerShapes.js +139 -0
- package/dist/core/strokeMarkerShapes.js.map +1 -0
- package/dist/core/strokeMarkers.js +28 -0
- package/dist/core/strokeMarkers.js.map +1 -0
- package/dist/core/stylus/stylus.js +39 -0
- package/dist/core/stylus/stylus.js.map +1 -0
- package/dist/core/stylus/usePointerStylus.js +51 -0
- package/dist/core/stylus/usePointerStylus.js.map +1 -0
- package/dist/core/usePaintKinds.js +17 -0
- package/dist/core/usePaintKinds.js.map +1 -0
- package/dist/core/viewport/clampView.js +24 -0
- package/dist/core/viewport/clampView.js.map +1 -0
- package/dist/core/viewport/clientToWorld.js +8 -0
- package/dist/core/viewport/clientToWorld.js.map +1 -0
- package/dist/core/viewport/createVelocityTracker.js +39 -0
- package/dist/core/viewport/createVelocityTracker.js.map +1 -0
- package/dist/core/viewport/fitToBounds.js +18 -0
- package/dist/core/viewport/fitToBounds.js.map +1 -0
- package/dist/core/viewport/fitViewToBounds.js +36 -0
- package/dist/core/viewport/fitViewToBounds.js.map +1 -0
- package/dist/core/viewport/interpolateView.js +34 -0
- package/dist/core/viewport/interpolateView.js.map +1 -0
- package/dist/core/viewport/meanScale.js +8 -0
- package/dist/core/viewport/meanScale.js.map +1 -0
- package/dist/core/viewport/parallax.js +111 -0
- package/dist/core/viewport/parallax.js.map +1 -0
- package/dist/core/viewport/pxExtent.js +42 -0
- package/dist/core/viewport/pxExtent.js.map +1 -0
- package/dist/core/viewport/sceneNodeClientRect.js +18 -0
- package/dist/core/viewport/sceneNodeClientRect.js.map +1 -0
- package/dist/core/viewport/screenSlop.js +27 -0
- package/dist/core/viewport/screenSlop.js.map +1 -0
- package/dist/core/viewport/useAutoCenter.js +32 -0
- package/dist/core/viewport/useAutoCenter.js.map +1 -0
- package/dist/core/viewport/useCanvasSize.js +29 -0
- package/dist/core/viewport/useCanvasSize.js.map +1 -0
- package/dist/core/viewport/useDecayLoop.js +63 -0
- package/dist/core/viewport/useDecayLoop.js.map +1 -0
- package/dist/core/viewport/useVelocityTracker.js +10 -0
- package/dist/core/viewport/useVelocityTracker.js.map +1 -0
- package/dist/core/viewport/useViewAnimation.js +63 -0
- package/dist/core/viewport/useViewAnimation.js.map +1 -0
- package/dist/core/viewport/view.js +37 -0
- package/dist/core/viewport/view.js.map +1 -0
- package/dist/core/viewport/viewTransform.js +11 -0
- package/dist/core/viewport/viewTransform.js.map +1 -0
- package/dist/core/viewport/viewportWorldRect.js +13 -0
- package/dist/core/viewport/viewportWorldRect.js.map +1 -0
- package/dist/core/viewport/wheelHandler.js +30 -0
- package/dist/core/viewport/wheelHandler.js.map +1 -0
- package/dist/core/viewport/zoomAt.js +22 -0
- package/dist/core/viewport/zoomAt.js.map +1 -0
- package/dist/core/viewport/zoomBounds.js +20 -0
- package/dist/core/viewport/zoomBounds.js.map +1 -0
- package/dist/{pointSnapToGrid-Dp2IxLGb.d.ts → cornerHandles-CDcZOV8h.d.ts} +3 -13
- package/dist/debug/createDebugOverlayLayer.js +358 -0
- package/dist/debug/createDebugOverlayLayer.js.map +1 -0
- package/dist/debug/createDebugSink.js +83 -0
- package/dist/debug/createDebugSink.js.map +1 -0
- package/dist/debug/defaultTheme.js +31 -0
- package/dist/debug/defaultTheme.js.map +1 -0
- package/dist/debug/flag.js +41 -0
- package/dist/debug/flag.js.map +1 -0
- package/dist/debug/frameStats.js +16 -0
- package/dist/debug/frameStats.js.map +1 -0
- package/dist/debug/parseDebugFlags.js +32 -0
- package/dist/debug/parseDebugFlags.js.map +1 -0
- package/dist/features/chrome-caps/buildChromeCtx.js +16 -0
- package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -0
- package/dist/features/chrome-caps/conditions.js +36 -0
- package/dist/features/chrome-caps/conditions.js.map +1 -0
- package/dist/features/chrome-caps/defaults.js +26 -0
- package/dist/features/chrome-caps/defaults.js.map +1 -0
- package/dist/features/chrome-caps/index.js +7 -0
- package/dist/features/chrome-caps/resolve.js +23 -0
- package/dist/features/chrome-caps/resolve.js.map +1 -0
- package/dist/features/chrome-caps/useHoverTracking.js +27 -0
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -0
- package/dist/features/cursor/paintedCursorLayer.js +60 -0
- package/dist/features/cursor/paintedCursorLayer.js.map +1 -0
- package/dist/features/focus/gateLayer.js +14 -0
- package/dist/features/focus/gateLayer.js.map +1 -0
- package/dist/features/focus/useCanvasFocus.js +29 -0
- package/dist/features/focus/useCanvasFocus.js.map +1 -0
- package/dist/features/groups/children.js +23 -0
- package/dist/features/groups/children.js.map +1 -0
- package/dist/features/groups/composePose.js +67 -0
- package/dist/features/groups/composePose.js.map +1 -0
- package/dist/features/groups/nestedHit.js +40 -0
- package/dist/features/groups/nestedHit.js.map +1 -0
- package/dist/features/groups/unionOfChildren.js +15 -0
- package/dist/features/groups/unionOfChildren.js.map +1 -0
- package/dist/features/images/imageCache.js +94 -0
- package/dist/features/images/imageCache.js.map +1 -0
- package/dist/features/ingestion/contentHandlers.js +37 -0
- package/dist/features/ingestion/contentHandlers.js.map +1 -0
- package/dist/features/ingestion/imageHandler.js +45 -0
- package/dist/features/ingestion/imageHandler.js.map +1 -0
- package/dist/features/ingestion/index.js +8 -0
- package/dist/features/ingestion/openFilePicker.js +15 -0
- package/dist/features/ingestion/openFilePicker.js.map +1 -0
- package/dist/features/ingestion/registerKitHandlers.js +26 -0
- package/dist/features/ingestion/registerKitHandlers.js.map +1 -0
- package/dist/features/ingestion/svgHandler.js +58 -0
- package/dist/features/ingestion/svgHandler.js.map +1 -0
- package/dist/features/ingestion/weaselJsonHandler.js +39 -0
- package/dist/features/ingestion/weaselJsonHandler.js.map +1 -0
- package/dist/features/longPress/longPressFeedback.js +96 -0
- package/dist/features/longPress/longPressFeedback.js.map +1 -0
- package/dist/features/meshPaint/bake.js +79 -0
- package/dist/features/meshPaint/bake.js.map +1 -0
- package/dist/features/meshPaint/bakeCache.js +59 -0
- package/dist/features/meshPaint/bakeCache.js.map +1 -0
- package/dist/features/meshPaint/handles.js +86 -0
- package/dist/features/meshPaint/handles.js.map +1 -0
- package/dist/features/meshPaint/lazyKind.js +1298 -0
- package/dist/features/meshPaint/lazyKind.js.map +1 -0
- package/dist/features/meshPaint/meshPaint.js +236 -0
- package/dist/features/meshPaint/meshPaint.js.map +1 -0
- package/dist/features/meshPaint/meshShader.js +6 -0
- package/dist/features/meshPaint/meshShader.js.map +1 -0
- package/dist/features/meshPaint/register.js +7 -0
- package/dist/features/meshPaint/register.js.map +1 -0
- package/dist/features/meshPaint/surface.js +110 -0
- package/dist/features/meshPaint/surface.js.map +1 -0
- package/dist/features/minimap/actions.js +53 -0
- package/dist/features/minimap/actions.js.map +1 -0
- package/dist/features/minimap/createMinimapContribution.js +96 -0
- package/dist/features/minimap/createMinimapContribution.js.map +1 -0
- package/dist/features/minimap/layers.js +103 -0
- package/dist/features/minimap/layers.js.map +1 -0
- package/dist/features/modes/modeLayers.js +113 -0
- package/dist/features/modes/modeLayers.js.map +1 -0
- package/dist/features/overlays/useNodeOverlayFrame.js +103 -0
- package/dist/features/overlays/useNodeOverlayFrame.js.map +1 -0
- package/dist/features/parallax/createParallaxLayer.js +26 -0
- package/dist/features/parallax/createParallaxLayer.js.map +1 -0
- package/dist/features/parallax/createParallaxPlane.js +26 -0
- package/dist/features/parallax/createParallaxPlane.js.map +1 -0
- package/dist/features/paths/anchorEdits.js +156 -0
- package/dist/features/paths/anchorEdits.js.map +1 -0
- package/dist/features/paths/anchors.js +154 -0
- package/dist/features/paths/anchors.js.map +1 -0
- package/dist/features/paths/booleans.js +2 -0
- package/dist/features/paths/index.js +15 -0
- package/dist/features/paths/markerCommands.js +116 -0
- package/dist/features/paths/markerCommands.js.map +1 -0
- package/dist/features/paths/markerSites.js +59 -0
- package/dist/features/paths/markerSites.js.map +1 -0
- package/dist/features/paths/markers.js +95 -0
- package/dist/features/paths/markers.js.map +1 -0
- package/dist/features/paths/nearestAnchor.js +36 -0
- package/dist/features/paths/nearestAnchor.js.map +1 -0
- package/dist/features/paths/originProjection.js +16 -0
- package/dist/features/paths/originProjection.js.map +1 -0
- package/dist/features/paths/pathEditingOverlayLayer.js +137 -0
- package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -0
- package/dist/features/paths/pathInWorld.js +41 -0
- package/dist/features/paths/pathInWorld.js.map +1 -0
- package/dist/features/paths/pathLayer.js +44 -0
- package/dist/features/paths/pathLayer.js.map +1 -0
- package/dist/features/paths/penPreviewLayer.js +220 -0
- package/dist/features/paths/penPreviewLayer.js.map +1 -0
- package/dist/features/paths/poseDescriptor.js +44 -0
- package/dist/features/paths/poseDescriptor.js.map +1 -0
- package/dist/features/paths/tessellate/stroke.js +230 -0
- package/dist/features/paths/tessellate/stroke.js.map +1 -0
- package/dist/features/patterns/index.js +23 -0
- package/dist/features/patterns/index.js.map +1 -0
- package/dist/features/patterns/patterns-builtin.js +38 -0
- package/dist/features/patterns/patterns-builtin.js.map +1 -0
- package/dist/features/patterns/resolveSpec.js +57 -0
- package/dist/features/patterns/resolveSpec.js.map +1 -0
- package/dist/features/patterns/tileGeometry.js +158 -0
- package/dist/features/patterns/tileGeometry.js.map +1 -0
- package/dist/features/pointer/PointerContext.js +45 -0
- package/dist/features/pointer/PointerContext.js.map +1 -0
- package/dist/features/poseRun/usePoseRun.js +70 -0
- package/dist/features/poseRun/usePoseRun.js.map +1 -0
- package/dist/features/selection/SelectionContext.js +46 -0
- package/dist/features/selection/SelectionContext.js.map +1 -0
- package/dist/features/selection/overlay.js +442 -0
- package/dist/features/selection/overlay.js.map +1 -0
- package/dist/features/simulation/createSimulation.js +61 -0
- package/dist/features/simulation/createSimulation.js.map +1 -0
- package/dist/features/simulation/types.js +6 -0
- package/dist/features/simulation/types.js.map +1 -0
- package/dist/features/simulation/useSimulation.js +74 -0
- package/dist/features/simulation/useSimulation.js.map +1 -0
- package/dist/features/text/domRuns.js +258 -0
- package/dist/features/text/domRuns.js.map +1 -0
- package/dist/features/text/fitTextPose.js +38 -0
- package/dist/features/text/fitTextPose.js.map +1 -0
- package/dist/features/text/hitTest.js +45 -0
- package/dist/features/text/hitTest.js.map +1 -0
- package/dist/features/text/renderLabel.js +14 -0
- package/dist/features/text/renderLabel.js.map +1 -0
- package/dist/features/text/runs/effectiveRangeStyle.js +66 -0
- package/dist/features/text/runs/effectiveRangeStyle.js.map +1 -0
- package/dist/features/text/runs/flagRange.js +53 -0
- package/dist/features/text/runs/flagRange.js.map +1 -0
- package/dist/features/text/runs/rangeStyle.js +135 -0
- package/dist/features/text/runs/rangeStyle.js.map +1 -0
- package/dist/features/text/textCommand.js +59 -0
- package/dist/features/text/textCommand.js.map +1 -0
- package/dist/features/text/textLayer.js +35 -0
- package/dist/features/text/textLayer.js.map +1 -0
- package/dist/features/text/textToPath.js +181 -0
- package/dist/features/text/textToPath.js.map +1 -0
- package/dist/features/text/useSceneTextEdit.js +138 -0
- package/dist/features/text/useSceneTextEdit.js.map +1 -0
- package/dist/features/text/useTextEdit.js +465 -0
- package/dist/features/text/useTextEdit.js.map +1 -0
- package/dist/features/tiling/createTiledLayer.js +63 -0
- package/dist/features/tiling/createTiledLayer.js.map +1 -0
- package/dist/features/tiling/tiledProject.js +14 -0
- package/dist/features/tiling/tiledProject.js.map +1 -0
- package/dist/features/viewports/viewResolver.js +59 -0
- package/dist/features/viewports/viewResolver.js.map +1 -0
- package/dist/features/viewports/viewportLayer.js +58 -0
- package/dist/features/viewports/viewportLayer.js.map +1 -0
- package/dist/icons/ArrowIcon.js +23 -0
- package/dist/icons/ArrowIcon.js.map +1 -0
- package/dist/icons/EllipseIcon.js +21 -0
- package/dist/icons/EllipseIcon.js.map +1 -0
- package/dist/icons/EyedropperIcon.js +49 -0
- package/dist/icons/EyedropperIcon.js.map +1 -0
- package/dist/icons/HandIcon.js +59 -0
- package/dist/icons/HandIcon.js.map +1 -0
- package/dist/icons/ImageIcon.js +34 -0
- package/dist/icons/ImageIcon.js.map +1 -0
- package/dist/icons/LassoIcon.js +22 -0
- package/dist/icons/LassoIcon.js.map +1 -0
- package/dist/icons/LineIcon.js +22 -0
- package/dist/icons/LineIcon.js.map +1 -0
- package/dist/icons/PenIcon.js +36 -0
- package/dist/icons/PenIcon.js.map +1 -0
- package/dist/icons/PencilIcon.js +25 -0
- package/dist/icons/PencilIcon.js.map +1 -0
- package/dist/icons/PolygonIcon.js +19 -0
- package/dist/icons/PolygonIcon.js.map +1 -0
- package/dist/icons/RectIcon.js +37 -0
- package/dist/icons/RectIcon.js.map +1 -0
- package/dist/icons/SelectIcon.js +20 -0
- package/dist/icons/SelectIcon.js.map +1 -0
- package/dist/icons/StarIcon.js +19 -0
- package/dist/icons/StarIcon.js.map +1 -0
- package/dist/icons/TextIcon.js +19 -0
- package/dist/icons/TextIcon.js.map +1 -0
- package/dist/icons/UnknownIcon.js +33 -0
- package/dist/icons/UnknownIcon.js.map +1 -0
- package/dist/icons/_base.js +12 -0
- package/dist/icons/_base.js.map +1 -0
- package/dist/index.css +2 -62
- package/dist/index.d.ts +1955 -1891
- package/dist/index.js +312 -13
- package/dist/input/keyState.js +76 -0
- package/dist/input/keyState.js.map +1 -0
- package/dist/input/useKeyState.js +22 -0
- package/dist/input/useKeyState.js.map +1 -0
- package/dist/interactions/actions/actionShortcuts.js +32 -0
- package/dist/interactions/actions/actionShortcuts.js.map +1 -0
- package/dist/interactions/actions/align/align.js +81 -0
- package/dist/interactions/actions/align/align.js.map +1 -0
- package/dist/interactions/actions/booleans/booleans.js +120 -0
- package/dist/interactions/actions/booleans/booleans.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleans.js +20 -0
- package/dist/interactions/actions/booleans/useBooleans.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleansAdapter.js +9 -0
- package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js +94 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -0
- package/dist/interactions/actions/clipboard/materializePaste.js +25 -0
- package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -0
- package/dist/interactions/actions/clipboard/wireFormat.js +43 -0
- package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -0
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +26 -0
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +1 -0
- package/dist/interactions/actions/defaultCommitAdapter.js +42 -0
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -0
- package/dist/interactions/actions/defaults/align.js +71 -0
- package/dist/interactions/actions/defaults/align.js.map +1 -0
- package/dist/interactions/actions/defaults/anchorEditing.js +235 -0
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -0
- package/dist/interactions/actions/defaults/areaSelect.js +75 -0
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -0
- package/dist/interactions/actions/defaults/booleans.js +52 -0
- package/dist/interactions/actions/defaults/booleans.js.map +1 -0
- package/dist/interactions/actions/defaults/cancelGesture.js +24 -0
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -0
- package/dist/interactions/actions/defaults/clearSelection.js +19 -0
- package/dist/interactions/actions/defaults/clearSelection.js.map +1 -0
- package/dist/interactions/actions/defaults/clipboard.js +78 -0
- package/dist/interactions/actions/defaults/clipboard.js.map +1 -0
- package/dist/interactions/actions/defaults/clone.js +96 -0
- package/dist/interactions/actions/defaults/clone.js.map +1 -0
- package/dist/interactions/actions/defaults/createOutlines.js +47 -0
- package/dist/interactions/actions/defaults/createOutlines.js.map +1 -0
- package/dist/interactions/actions/defaults/createPaintAction.js +85 -0
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -0
- package/dist/interactions/actions/defaults/delete.js +61 -0
- package/dist/interactions/actions/defaults/delete.js.map +1 -0
- package/dist/interactions/actions/defaults/distribute.js +66 -0
- package/dist/interactions/actions/defaults/distribute.js.map +1 -0
- package/dist/interactions/actions/defaults/duplicate.js +83 -0
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -0
- package/dist/interactions/actions/defaults/editAnchors.js +100 -0
- package/dist/interactions/actions/defaults/editAnchors.js.map +1 -0
- package/dist/interactions/actions/defaults/enterPathEdit.js +29 -0
- package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -0
- package/dist/interactions/actions/defaults/enterTextEdit.js +20 -0
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -0
- package/dist/interactions/actions/defaults/escape.js +26 -0
- package/dist/interactions/actions/defaults/escape.js.map +1 -0
- package/dist/interactions/actions/defaults/exitPathEdit.js +22 -0
- package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -0
- package/dist/interactions/actions/defaults/flip.js +119 -0
- package/dist/interactions/actions/defaults/flip.js.map +1 -0
- package/dist/interactions/actions/defaults/freshNodeId.js +10 -0
- package/dist/interactions/actions/defaults/freshNodeId.js.map +1 -0
- package/dist/interactions/actions/defaults/group.js +131 -0
- package/dist/interactions/actions/defaults/group.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js +40 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphs.js +10 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphs.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/alignIcons.js +173 -0
- package/dist/interactions/actions/defaults/icons/alignIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/booleanIcons.js +171 -0
- package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/distributeIcons.js +63 -0
- package/dist/interactions/actions/defaults/icons/distributeIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/editIcons.js +280 -0
- package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/outlineIcons.js +53 -0
- package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/ingest.js +58 -0
- package/dist/interactions/actions/defaults/ingest.js.map +1 -0
- package/dist/interactions/actions/defaults/insert.js +288 -0
- package/dist/interactions/actions/defaults/insert.js.map +1 -0
- package/dist/interactions/actions/defaults/insertPathAnchor.js +50 -0
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -0
- package/dist/interactions/actions/defaults/lassoSelect.js +156 -0
- package/dist/interactions/actions/defaults/lassoSelect.js.map +1 -0
- package/dist/interactions/actions/defaults/move.js +656 -0
- package/dist/interactions/actions/defaults/move.js.map +1 -0
- package/dist/interactions/actions/defaults/nudge.js +110 -0
- package/dist/interactions/actions/defaults/nudge.js.map +1 -0
- package/dist/interactions/actions/defaults/pinchZoom.js +63 -0
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -0
- package/dist/interactions/actions/defaults/reorder.js +143 -0
- package/dist/interactions/actions/defaults/reorder.js.map +1 -0
- package/dist/interactions/actions/defaults/requiresSelection.js +10 -0
- package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -0
- package/dist/interactions/actions/defaults/resize.js +332 -0
- package/dist/interactions/actions/defaults/resize.js.map +1 -0
- package/dist/interactions/actions/defaults/rotate.js +181 -0
- package/dist/interactions/actions/defaults/rotate.js.map +1 -0
- package/dist/interactions/actions/defaults/selectAll.js +27 -0
- package/dist/interactions/actions/defaults/selectAll.js.map +1 -0
- package/dist/interactions/actions/defaults/setFill.js +27 -0
- package/dist/interactions/actions/defaults/setFill.js.map +1 -0
- package/dist/interactions/actions/defaults/setFillOpacity.js +15 -0
- package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -0
- package/dist/interactions/actions/defaults/setStroke.js +36 -0
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -0
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +21 -0
- package/dist/interactions/actions/defaults/setStrokeOpacity.js.map +1 -0
- package/dist/interactions/actions/defaults/slice.js +39 -0
- package/dist/interactions/actions/defaults/slice.js.map +1 -0
- package/dist/interactions/actions/defaults/sliceOps.js +60 -0
- package/dist/interactions/actions/defaults/sliceOps.js.map +1 -0
- package/dist/interactions/actions/defaults/toolActivate.js +35 -0
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -0
- package/dist/interactions/actions/defaults/toolResetToDefault.js +26 -0
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -0
- package/dist/interactions/actions/defaults/undoRedo.js +51 -0
- package/dist/interactions/actions/defaults/undoRedo.js.map +1 -0
- package/dist/interactions/actions/defaults/viewportDragPan.js +88 -0
- package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -0
- package/dist/interactions/actions/defaults/viewportWheelPan.js +57 -0
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -0
- package/dist/interactions/actions/defaults/viewportZoom.js +143 -0
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -0
- package/dist/interactions/actions/distribute/distribute.js +42 -0
- package/dist/interactions/actions/distribute/distribute.js.map +1 -0
- package/dist/interactions/actions/distribute/plan.js +29 -0
- package/dist/interactions/actions/distribute/plan.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/geometry.js +61 -0
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/handles.js +43 -0
- package/dist/interactions/actions/edit-anchors/handles.js.map +1 -0
- package/dist/interactions/actions/flip/helpers.js +35 -0
- package/dist/interactions/actions/flip/helpers.js.map +1 -0
- package/dist/interactions/actions/geometryProjection.js +18 -0
- package/dist/interactions/actions/geometryProjection.js.map +1 -0
- package/dist/interactions/actions/gestureLifecycle.js +44 -0
- package/dist/interactions/actions/gestureLifecycle.js.map +1 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +39 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +36 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +67 -0
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -0
- package/dist/interactions/actions/move/gestureAdapter.js +37 -0
- package/dist/interactions/actions/move/gestureAdapter.js.map +1 -0
- package/dist/interactions/actions/outlines/createOutlines.js +84 -0
- package/dist/interactions/actions/outlines/createOutlines.js.map +1 -0
- package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +9 -0
- package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js.map +1 -0
- package/dist/interactions/actions/planeInput.js +168 -0
- package/dist/interactions/actions/planeInput.js.map +1 -0
- package/dist/interactions/actions/poseDescriptorDep.js +9 -0
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -0
- package/dist/interactions/actions/poseFrame.js +38 -0
- package/dist/interactions/actions/poseFrame.js.map +1 -0
- package/dist/interactions/actions/previewOverrides.js +25 -0
- package/dist/interactions/actions/previewOverrides.js.map +1 -0
- package/dist/interactions/actions/resize/autoPoseDescriptor.js +32 -0
- package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/clampMinSize.js +18 -0
- package/dist/interactions/actions/resize/behaviors/clampMinSize.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/index.js +8 -0
- package/dist/interactions/actions/resize/behaviors/index.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js +24 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -0
- package/dist/interactions/actions/resize/cornerHandles.js +72 -0
- package/dist/interactions/actions/resize/cornerHandles.js.map +1 -0
- package/dist/interactions/actions/resolveOverlays.js +60 -0
- package/dist/interactions/actions/resolveOverlays.js.map +1 -0
- package/dist/interactions/actions/resolvePreviews.js +61 -0
- package/dist/interactions/actions/resolvePreviews.js.map +1 -0
- package/dist/interactions/actions/rotate/geometry.js +46 -0
- package/dist/interactions/actions/rotate/geometry.js.map +1 -0
- package/dist/interactions/actions/rotate/handle.js +27 -0
- package/dist/interactions/actions/rotate/handle.js.map +1 -0
- package/dist/interactions/actions/spatialReference.js +42 -0
- package/dist/interactions/actions/spatialReference.js.map +1 -0
- package/dist/interactions/actions/useStandardActions.js +142 -0
- package/dist/interactions/actions/useStandardActions.js.map +1 -0
- package/dist/interactions/gestures/dragGesture/dragGesture.js +111 -0
- package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -0
- package/dist/interactions/gestures/dragRadial/dragRadial.js +117 -0
- package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -0
- package/dist/interactions/gestures/dragRect/dragRect.js +164 -0
- package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js +46 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -0
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +118 -0
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -0
- package/dist/interactions/gestures/shared/originProjection.js +42 -0
- package/dist/interactions/gestures/shared/originProjection.js.map +1 -0
- package/dist/interactions/gestures/shared/screenTolerance.js +21 -0
- package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -0
- package/dist/interactions/gestures/shared/snap.js +24 -0
- package/dist/interactions/gestures/shared/snap.js.map +1 -0
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +30 -0
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -0
- package/dist/layout/arrivals.js +36 -0
- package/dist/layout/arrivals.js.map +1 -0
- package/dist/{math-MCQcf_gc.d.ts → math-CUMxmZzn.d.ts} +8 -116
- package/dist/math.d.ts +4 -5
- package/dist/math.js +6 -4
- package/dist/mesh.d.ts +268 -0
- package/dist/mesh.js +7 -0
- package/dist/move.d.ts +7 -49
- package/dist/move.js +3 -142
- package/dist/originProjection-BSn4xiEy.d.ts +57 -0
- package/dist/patterns-builtin.js +3 -3
- package/dist/{poseDescriptor-rZa9W5hJ.d.ts → poseDescriptor-CjSXMf8X.d.ts} +3 -3
- package/dist/registerProgram-ateHDGjw.d.ts +193 -0
- package/dist/renderer/DrawCommand.js +6 -0
- package/dist/renderer/DrawCommand.js.map +1 -0
- package/dist/renderer/WeaselRenderer.js +328 -0
- package/dist/renderer/WeaselRenderer.js.map +1 -0
- package/dist/renderer/cache/GLImageCache.js +64 -0
- package/dist/renderer/cache/GLImageCache.js.map +1 -0
- package/dist/renderer/cache/GLMeshCache.js +102 -0
- package/dist/renderer/cache/GLMeshCache.js.map +1 -0
- package/dist/renderer/cache/GLTextureCache.js +51 -0
- package/dist/renderer/cache/GLTextureCache.js.map +1 -0
- package/dist/renderer/cache/GradientRampAtlas.js +82 -0
- package/dist/renderer/cache/GradientRampAtlas.js.map +1 -0
- package/dist/renderer/cache/cache.js +13 -0
- package/dist/renderer/cache/cache.js.map +1 -0
- package/dist/renderer/cache/markerCommandCache.js +59 -0
- package/dist/renderer/cache/markerCommandCache.js.map +1 -0
- package/dist/renderer/cache/outlineMeshCache.js +15 -0
- package/dist/renderer/cache/outlineMeshCache.js.map +1 -0
- package/dist/renderer/cache/outlineStrokeMeshCache.js +31 -0
- package/dist/renderer/cache/outlineStrokeMeshCache.js.map +1 -0
- package/dist/renderer/cache/strokeMeshCache.js +44 -0
- package/dist/renderer/cache/strokeMeshCache.js.map +1 -0
- package/dist/renderer/cullDrawCommands.js +89 -0
- package/dist/renderer/cullDrawCommands.js.map +1 -0
- package/dist/renderer/draw.js +1109 -0
- package/dist/renderer/draw.js.map +1 -0
- package/dist/renderer/drawBatch.js +168 -0
- package/dist/renderer/drawBatch.js.map +1 -0
- package/dist/renderer/effects/EffectTargets.js +45 -0
- package/dist/renderer/effects/EffectTargets.js.map +1 -0
- package/dist/renderer/effects/builtins.js +31 -0
- package/dist/renderer/effects/builtins.js.map +1 -0
- package/dist/renderer/effects/composite.js +9 -0
- package/dist/renderer/effects/composite.js.map +1 -0
- package/dist/renderer/effects/effectPrelude.js +10 -0
- package/dist/renderer/effects/effectPrelude.js.map +1 -0
- package/dist/renderer/effects/types.js +10 -0
- package/dist/renderer/effects/types.js.map +1 -0
- package/dist/renderer/index.js +19 -0
- package/dist/renderer/math/color.js +341 -0
- package/dist/renderer/math/color.js.map +1 -0
- package/dist/renderer/math/mat3.js +71 -0
- package/dist/renderer/math/mat3.js.map +1 -0
- package/dist/renderer/math/patternSpace.js +22 -0
- package/dist/renderer/math/patternSpace.js.map +1 -0
- package/dist/renderer/math/viewToMat3.js +19 -0
- package/dist/renderer/math/viewToMat3.js.map +1 -0
- package/dist/renderer/paintResources.js +18 -0
- package/dist/renderer/paintResources.js.map +1 -0
- package/dist/renderer/paintScratch.js +37 -0
- package/dist/renderer/paintScratch.js.map +1 -0
- package/dist/renderer/shaders/ShaderProgram.js +74 -0
- package/dist/renderer/shaders/ShaderProgram.js.map +1 -0
- package/dist/renderer/shaders/batchFill.js +118 -0
- package/dist/renderer/shaders/batchFill.js.map +1 -0
- package/dist/renderer/shaders/customPrelude.js +34 -0
- package/dist/renderer/shaders/customPrelude.js.map +1 -0
- package/dist/renderer/shaders/extractUniformNames.js +184 -0
- package/dist/renderer/shaders/extractUniformNames.js.map +1 -0
- package/dist/renderer/shaders/glyphPaint.js +61 -0
- package/dist/renderer/shaders/glyphPaint.js.map +1 -0
- package/dist/renderer/shaders/gradFill.js +30 -0
- package/dist/renderer/shaders/gradFill.js.map +1 -0
- package/dist/renderer/shaders/imageFill.js +14 -0
- package/dist/renderer/shaders/imageFill.js.map +1 -0
- package/dist/renderer/shaders/pathFill.js +13 -0
- package/dist/renderer/shaders/pathFill.js.map +1 -0
- package/dist/renderer/shaders/patternFill.js +24 -0
- package/dist/renderer/shaders/patternFill.js.map +1 -0
- package/dist/renderer/shaders/registerProgram.js +18 -0
- package/dist/renderer/shaders/registerProgram.js.map +1 -0
- package/dist/renderer/spriteSheet.js +14 -0
- package/dist/renderer/spriteSheet.js.map +1 -0
- package/dist/renderer/state/GroupState.js +77 -0
- package/dist/renderer/state/GroupState.js.map +1 -0
- package/dist/renderer/syntheticItalic.js +6 -0
- package/dist/renderer/syntheticItalic.js.map +1 -0
- package/dist/renderer/textures/registerTexture.js +14 -0
- package/dist/renderer/textures/registerTexture.js.map +1 -0
- package/dist/renderer.d.ts +11 -21
- package/dist/renderer.js +18 -13
- package/dist/resize.d.ts +10 -46
- package/dist/resize.js +7 -5
- package/dist/routing.js +2 -3
- package/dist/scheduling/useVisibleRaf.js +69 -0
- package/dist/scheduling/useVisibleRaf.js.map +1 -0
- package/dist/test-hook/createTestHook.js +39 -0
- package/dist/test-hook/createTestHook.js.map +1 -0
- package/dist/test-hook/install.js +12 -0
- package/dist/test-hook/install.js.map +1 -0
- package/dist/test-seams-fYf6m5pu.d.ts +356 -0
- package/dist/test-seams.d.ts +6 -0
- package/dist/test-seams.js +3 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js +33 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -0
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js +55 -0
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -0
- package/dist/tools/builtin/hand/dragPanContribution.js +17 -0
- package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -0
- package/dist/tools/builtin/hand/useHandTool.js +31 -0
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -0
- package/dist/tools/builtin/image/useImageTool.js +41 -0
- package/dist/tools/builtin/image/useImageTool.js.map +1 -0
- package/dist/tools/builtin/lasso/useLassoTool.js +42 -0
- package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -0
- package/dist/tools/builtin/line/useLineTool.js +33 -0
- package/dist/tools/builtin/line/useLineTool.js.map +1 -0
- package/dist/tools/builtin/pen/usePenTool.js +414 -0
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -0
- package/dist/tools/builtin/pencil/usePencilTool.js +36 -0
- package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -0
- package/dist/tools/builtin/pickTopMostHit.js +45 -0
- package/dist/tools/builtin/pickTopMostHit.js.map +1 -0
- package/dist/tools/builtin/polygon/usePolygonTool.js +81 -0
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -0
- package/dist/tools/builtin/rect/useRectTool.js +32 -0
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +109 -0
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -0
- package/dist/tools/builtin/select/useSelectTool.js +162 -0
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -0
- package/dist/tools/builtin/shared/insertToolOptions.js +8 -0
- package/dist/tools/builtin/shared/insertToolOptions.js.map +1 -0
- package/dist/tools/builtin/slice/useSliceTool.js +263 -0
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -0
- package/dist/tools/builtin/star/useStarTool.js +82 -0
- package/dist/tools/builtin/star/useStarTool.js.map +1 -0
- package/dist/tools/builtin/text/useTextTool.js +177 -0
- package/dist/tools/builtin/text/useTextTool.js.map +1 -0
- package/dist/tools/overlayBinding.js +8 -0
- package/dist/tools/overlayBinding.js.map +1 -0
- package/dist/tools/prefs.js +47 -0
- package/dist/tools/prefs.js.map +1 -0
- package/dist/tools/useKeybindings.js +66 -0
- package/dist/tools/useKeybindings.js.map +1 -0
- package/dist/{types-D-9QWBy5.d.ts → types-CA54-mAZ.d.ts} +181 -13
- package/dist/{types-qYpyTAiZ.d.ts → types-DSjd6W3n.d.ts} +32 -6
- package/dist/util/color.js +26 -0
- package/dist/util/color.js.map +1 -0
- package/dist/util/constrainTo45.js +17 -0
- package/dist/util/constrainTo45.js.map +1 -0
- package/dist/util/paint.js +72 -0
- package/dist/util/paint.js.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +29 -19
- package/dist/chunk-3TY6FHAF.js +0 -170
- package/dist/chunk-3TY6FHAF.js.map +0 -1
- package/dist/chunk-DGWNNKGD.js +0 -248
- package/dist/chunk-DGWNNKGD.js.map +0 -1
- package/dist/chunk-G4ZGQMY7.js +0 -33372
- package/dist/chunk-G4ZGQMY7.js.map +0 -1
- package/dist/chunk-L5YNZYEG.js +0 -648
- package/dist/chunk-L5YNZYEG.js.map +0 -1
- package/dist/chunk-LU4IJ52W.js +0 -111
- package/dist/chunk-LU4IJ52W.js.map +0 -1
- package/dist/chunk-M24CLARN.js +0 -28
- package/dist/chunk-M24CLARN.js.map +0 -1
- package/dist/chunk-NE27EOLP.js +0 -146
- package/dist/chunk-NE27EOLP.js.map +0 -1
- package/dist/chunk-PNNZSYRD.js +0 -318
- package/dist/chunk-PNNZSYRD.js.map +0 -1
- package/dist/chunk-UPZY4ART.js +0 -29
- package/dist/chunk-UPZY4ART.js.map +0 -1
- package/dist/chunk-WPNA6L5O.js +0 -250
- package/dist/chunk-WPNA6L5O.js.map +0 -1
- package/dist/chunk-XMAWPGTK.js +0 -128
- package/dist/chunk-XMAWPGTK.js.map +0 -1
- package/dist/clipboard.js.map +0 -1
- package/dist/clone.js.map +0 -1
- package/dist/grid-CY5UKlZh.d.ts +0 -98
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/insert.d.ts +0 -36
- package/dist/insert.js +0 -81
- package/dist/insert.js.map +0 -1
- package/dist/math.js.map +0 -1
- package/dist/move.js.map +0 -1
- package/dist/path-JEV2c5If.d.ts +0 -48
- package/dist/patterns-builtin.js.map +0 -1
- package/dist/renderer.css +0 -62
- package/dist/renderer.css.map +0 -1
- package/dist/renderer.js.map +0 -1
- package/dist/resize.js.map +0 -1
- package/dist/routing.js.map +0 -1
- package/dist/types-D2tTKEU0.d.ts +0 -18
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Mat3 } from '@weasel-js/geom';
|
|
2
|
+
import { Reflection } from '@weasel-js/registry';
|
|
3
|
+
import { TextureHandle } from '@weasel-js/paint';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 2D affine matrix utilities. Column-major 9-element Float32Array, matching
|
|
7
|
+
* `WebGL2RenderingContext.uniformMatrix3fv` byte order so we can pass the
|
|
8
|
+
* array directly without a transpose flag.
|
|
9
|
+
*
|
|
10
|
+
* Layout (column-major):
|
|
11
|
+
* [m00, m10, 0,
|
|
12
|
+
* m01, m11, 0,
|
|
13
|
+
* tx, ty, 1]
|
|
14
|
+
*
|
|
15
|
+
* `apply(m, x, y)` returns `[m * (x, y, 1)] = [m00*x + m01*y + tx,
|
|
16
|
+
* m10*x + m11*y + ty]`.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** A 2D affine transform as a column-major 9-element `Float32Array`, laid out as above. */
|
|
20
|
+
type GlMat3 = Float32Array;
|
|
21
|
+
declare function identity(): GlMat3;
|
|
22
|
+
declare function multiply(out: GlMat3, m: GlMat3): GlMat3;
|
|
23
|
+
/** `m · T(tx, ty)`: composes onto `m`, where `@weasel-js/geom`'s `translate`
|
|
24
|
+
* constructs a fresh matrix. */
|
|
25
|
+
declare function translated(m: GlMat3, tx: number, ty: number): GlMat3;
|
|
26
|
+
/** `m · S(sx, sy)`: composes onto `m`, where geom's `scale` constructs one. */
|
|
27
|
+
declare function scaled(m: GlMat3, sx: number, sy: number): GlMat3;
|
|
28
|
+
/** This layout read as the kernel's 6-element affine. The two carry the same
|
|
29
|
+
* logical order, so the conversion is a repack and nothing else — it exists
|
|
30
|
+
* so the repack has a name instead of appearing inline at each crossing. */
|
|
31
|
+
declare function toAffine(m: GlMat3): Mat3;
|
|
32
|
+
/** The kernel's affine in this layout. The inverse of {@link toAffine}, and
|
|
33
|
+
* what an `SvgGroupNode.transform` (also a kernel affine) becomes on its way
|
|
34
|
+
* to a `GroupDrawCommand`. */
|
|
35
|
+
declare function fromAffine(a: Mat3): GlMat3;
|
|
36
|
+
/** Inverse of an affine matrix, or `null` when `@weasel-js/geom`'s `invert`
|
|
37
|
+
* finds it singular — the same rule, read through this layout. */
|
|
38
|
+
declare function invert(m: GlMat3): GlMat3 | null;
|
|
39
|
+
declare function apply(m: GlMat3, x: number, y: number): [number, number];
|
|
40
|
+
/**
|
|
41
|
+
* Map screen pixel coords (0..width on X, 0..height on Y, top-left origin)
|
|
42
|
+
* into clip space (-1..1 on X, 1..-1 on Y — note Y flip so screen-down
|
|
43
|
+
* matches clip-down).
|
|
44
|
+
*/
|
|
45
|
+
declare function screenToClip(width: number, height: number): GlMat3;
|
|
46
|
+
/**
|
|
47
|
+
* Uniform-equivalent scale factor: the square root of the absolute
|
|
48
|
+
* determinant of the linear part, i.e. the geometric mean of the two axis
|
|
49
|
+
* scales. Rotation-invariant. Under non-uniform scale it is between the two
|
|
50
|
+
* axes and exact on neither — the same compromise `meanScale` documents.
|
|
51
|
+
*/
|
|
52
|
+
declare function meanScaleOf(m: GlMat3): number;
|
|
53
|
+
/** The renderer's 3x3 matrix operations, as one namespace. These work on the
|
|
54
|
+
* 9-element `Float32Array` form the GL uniform upload wants — distinct from
|
|
55
|
+
* `@weasel-js/geom`'s 6-element affine `GlMat3`, though the logical element
|
|
56
|
+
* order is the same. */
|
|
57
|
+
declare const mat3: {
|
|
58
|
+
identity: typeof identity;
|
|
59
|
+
toAffine: typeof toAffine;
|
|
60
|
+
fromAffine: typeof fromAffine;
|
|
61
|
+
multiply: typeof multiply;
|
|
62
|
+
translated: typeof translated;
|
|
63
|
+
scaled: typeof scaled;
|
|
64
|
+
invert: typeof invert;
|
|
65
|
+
apply: typeof apply;
|
|
66
|
+
screenToClip: typeof screenToClip;
|
|
67
|
+
meanScaleOf: typeof meanScaleOf;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Minimal compile/link/lookup wrapper for a GL program. Throws
|
|
72
|
+
* `ShaderCompileError` on compile or link failure with the GL info log
|
|
73
|
+
* embedded in the error message — never returns a half-initialized program.
|
|
74
|
+
*
|
|
75
|
+
* Designed so test code can stub `getShaderParameter` / `getProgramParameter`
|
|
76
|
+
* via the recorder Proxy without further special-casing.
|
|
77
|
+
*/
|
|
78
|
+
type Stage = 'vertex' | 'fragment' | 'link';
|
|
79
|
+
/** Thrown when a shader fails to compile or link, carrying which stage failed
|
|
80
|
+
* and the driver's log. */
|
|
81
|
+
declare class ShaderCompileError extends Error {
|
|
82
|
+
readonly stage: Stage;
|
|
83
|
+
readonly log: string;
|
|
84
|
+
constructor(stage: Stage, log: string);
|
|
85
|
+
}
|
|
86
|
+
/** An array uniform a program can be written as a whole: its element type as
|
|
87
|
+
* declared, its declared length, and the location of slot 0. */
|
|
88
|
+
interface UniformArray {
|
|
89
|
+
readonly type: string;
|
|
90
|
+
readonly size: number;
|
|
91
|
+
readonly location: WebGLUniformLocation;
|
|
92
|
+
}
|
|
93
|
+
/** A linked GL program with its uniform and attribute locations cached by name. */
|
|
94
|
+
declare class ShaderProgram {
|
|
95
|
+
private readonly gl;
|
|
96
|
+
readonly handle: WebGLProgram;
|
|
97
|
+
private readonly uniforms;
|
|
98
|
+
private readonly arrays;
|
|
99
|
+
private readonly attributes;
|
|
100
|
+
constructor(gl: WebGL2RenderingContext, vertSrc: string, fragSrc: string);
|
|
101
|
+
private compile;
|
|
102
|
+
lookupUniforms(names: readonly string[]): void;
|
|
103
|
+
/** Record each array's slot-0 location under its bare name. An array the
|
|
104
|
+
* driver optimized away has no location and is left out. */
|
|
105
|
+
lookupUniformArrays(decls: ReadonlyMap<string, {
|
|
106
|
+
type: string;
|
|
107
|
+
size: number;
|
|
108
|
+
}>): void;
|
|
109
|
+
lookupAttributes(names: readonly string[]): void;
|
|
110
|
+
uniform(name: string): WebGLUniformLocation | undefined;
|
|
111
|
+
uniformArray(name: string): UniformArray | undefined;
|
|
112
|
+
attribute(name: string): number | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* registerProgram — public API for registering custom shader programs.
|
|
117
|
+
*
|
|
118
|
+
* Stores raw GLSL source strings in a module-level registry. GL compilation
|
|
119
|
+
* happens on each WeaselRenderer via WeaselRenderer.registerProgram(), which
|
|
120
|
+
* calls getProgramSource() and compiles the result. This keeps registerProgram
|
|
121
|
+
* GL-context-agnostic — identical pattern to registerFont storing ImageBitmap.
|
|
122
|
+
*
|
|
123
|
+
* Module-level state = source strings only; compiled GL
|
|
124
|
+
* programs live on each renderer's programRegistry (Map<id, ShaderProgram>).
|
|
125
|
+
*
|
|
126
|
+
* Lifecycle: program sources live for the module lifetime. No unregister in v1.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/** Opaque handle to a compiled custom shader program. */
|
|
130
|
+
interface ShaderProgramHandle {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A value for one uniform in `ShaderDrawCommand.uniforms`.
|
|
135
|
+
*
|
|
136
|
+
* | TS type | GL call |
|
|
137
|
+
* |-------------------------|--------------------------------------|
|
|
138
|
+
* | number | uniform1f |
|
|
139
|
+
* | [n, n] | uniform2fv |
|
|
140
|
+
* | [n, n, n] | uniform3fv |
|
|
141
|
+
* | [n, n, n, n] | uniform4fv |
|
|
142
|
+
* | Float32Array length 9 | uniformMatrix3fv (column-major) |
|
|
143
|
+
* | Float32Array length 16 | uniformMatrix4fv (column-major) |
|
|
144
|
+
* | TextureHandle | bind to next tex unit + uniform1i |
|
|
145
|
+
*
|
|
146
|
+
* **Array uniforms.** Keyed by an array's bare name (`u_ripples` for
|
|
147
|
+
* `uniform vec3 u_ripples[8]`), a flat `number[]`, `Float32Array`,
|
|
148
|
+
* `Int32Array` or `Uint32Array` fills the array from slot 0 in one
|
|
149
|
+
* `uniform*v` call chosen by the declared element type (`vec3` →
|
|
150
|
+
* `uniform3fv`, `ivec2` → `uniform2iv`, `mat4` → `uniformMatrix4fv`, …).
|
|
151
|
+
* Its length must be a whole number of elements and at most the declared
|
|
152
|
+
* size; a shorter value leaves the remaining slots as they were. Per-slot
|
|
153
|
+
* keys (`u_ripples[2]`) keep working and take the table above.
|
|
154
|
+
*/
|
|
155
|
+
type ShaderUniform = number | [number, number] | [number, number, number] | [number, number, number, number] | readonly number[] | Float32Array | Int32Array | Uint32Array | TextureHandle;
|
|
156
|
+
/** A registered program's GLSL source. An empty `vert` means the kit's default vertex shader. */
|
|
157
|
+
interface ProgramSource {
|
|
158
|
+
vert: string;
|
|
159
|
+
frag: string;
|
|
160
|
+
}
|
|
161
|
+
/** Every registered program's GLSL source, keyed by program id. */
|
|
162
|
+
declare const programSourceRegistry: Reflection<ProgramSource>;
|
|
163
|
+
/**
|
|
164
|
+
* Register a custom shader program by id.
|
|
165
|
+
*
|
|
166
|
+
* Pass an empty string for `vert` to use the kit's default vertex shader
|
|
167
|
+
* (recommended). The kit's vertex shader exposes `v_uv`, `v_screen`, and
|
|
168
|
+
* `v_world` varyings plus `u_bounds` and `u_view` uniforms.
|
|
169
|
+
*
|
|
170
|
+
* **IMPORTANT — Premultiplied alpha:**
|
|
171
|
+
* Your fragment shader MUST output premultiplied alpha:
|
|
172
|
+
* `outColor = vec4(rgb * a, a);` ← correct
|
|
173
|
+
* `outColor = vec4(rgb, a);` ← WRONG — over-brightens translucent regions
|
|
174
|
+
*
|
|
175
|
+
* The renderer uses `gl.blendFunc(ONE, ONE_MINUS_SRC_ALPHA)` to match.
|
|
176
|
+
* Opaque fragments (a=1) are unaffected; only fragments with a < 1 differ.
|
|
177
|
+
*
|
|
178
|
+
* **Re-registration behavior:**
|
|
179
|
+
* - Dev mode (`NODE_ENV !== 'production'`): calling with an existing id and new
|
|
180
|
+
* source replaces it (hot reload). Every renderer that compiled the old source
|
|
181
|
+
* recompiles on its next frame and deletes the program it replaces; a
|
|
182
|
+
* `<Canvas shaders>` naming the id repaints to show it. If the new source fails
|
|
183
|
+
* to compile, the renderer logs the error once and keeps drawing the old one.
|
|
184
|
+
* - Prod mode: calling with an existing id throws.
|
|
185
|
+
*
|
|
186
|
+
* Actual GL compilation and `ShaderCompileError` throwing happen in
|
|
187
|
+
* `WeaselRenderer.registerProgram()`, not here.
|
|
188
|
+
*
|
|
189
|
+
* @experimental API may break before v2.
|
|
190
|
+
*/
|
|
191
|
+
declare function registerProgram(id: string, vert: string, frag: string): ShaderProgramHandle;
|
|
192
|
+
|
|
193
|
+
export { type GlMat3 as G, type ProgramSource as P, ShaderCompileError as S, type ShaderProgramHandle as a, type ShaderUniform as b, ShaderProgram as c, mat3 as m, programSourceRegistry as p, registerProgram as r };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawCommand.js","names":["SPRITE_STRIDE"],"sources":["../../src/renderer/DrawCommand.ts"],"sourcesContent":["// Import the source types directly, NOT through the `@weasel-js/core` self-barrel.\n// `src/index.ts` reexports `renderer/index.ts`, which reexports this module — so a\n// barrel import here forms a DrawCommand.ts → index.ts → renderer/index.ts → DrawCommand.ts\n// cycle that makes the dts bundler split them into mutually-dependent chunks and warn.\nimport type { Path } from '@weasel-js/geom';\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport type { TextStyle } from '@weasel-js/text';\nimport type { ResolvedRun } from '@weasel-js/text';\nimport type { TextVerticalAlign } from '@weasel-js/text';\nimport type { GlMat3 } from './math/mat3';\nimport type { ShaderProgramHandle, ShaderUniform } from './shaders/registerProgram';\nimport type { Effect } from './effects/types';\n\n/**\n * Solid-fill paint variant (subset of the full `FillStyle` union from\n * `@weasel-js/core`). Kept for back-compat with step-1/2 consumers and\n * because some code reads `fill.color` directly. Through step 4, fills can\n * be any `FillStyle` variant — solid, pattern, or gradient.\n */\nexport interface SolidPaint {\n fill?: 'solid';\n /** Any CSS color string accepted by `parseColor`: hex, `rgb()`/`rgba()`, `hsl()`/`hsla()`, named, or `transparent`. */\n color: string;\n opacity?: number;\n}\n\n/** DrawCommand variants implemented through step 6. */\nexport type DrawCommand =\n | PathDrawCommand\n | GroupDrawCommand\n | TextDrawCommand\n | ImageDrawCommand\n | SpritesDrawCommand\n | ShaderDrawCommand;\n\n/** Draw a path, filled and/or stroked. The workhorse command: every shape the\n * kit draws that is not text, an image, or a custom shader is one of these. */\nexport interface PathDrawCommand {\n kind: 'path';\n path: Path;\n /** Any `FillStyle` variant: solid, pattern, or gradient (linear/radial/conic). */\n fill?: FillStyle;\n /** Stroke spec. Only solid `paint` supported through step 4. */\n stroke?: Stroke;\n /**\n * Optional flat RGBA-per-path-anchor color array (length =\n * `4 × countPathAnchors(path)`, floats in 0..1). The renderer\n * arc-length-interpolates these per-anchor colors across the\n * flattened/triangulated mesh between consecutive anchors using the\n * mesh's `anchorA` / `anchorB` / `anchorT` parameterization.\n *\n * **`fill` must also be set when using `vertexColors`.** The renderer\n * only enters the per-vertex shader path when the command has a fill\n * (the fill provides the opacity uniform; the vertex colors override\n * the fill's color). Pass any solid `fill` (e.g. `{ color: '#fff' }`)\n * as the placeholder; the per-vertex colors win in the shader.\n */\n vertexColors?: number[];\n}\n\n/** Draw a list of commands under a shared transform, opacity, color matrix\n * and clip. Groups nest, and their effects accumulate down the stack — this\n * is how a container node's transform reaches its descendants. */\nexport interface GroupDrawCommand {\n kind: 'group';\n transform?: GlMat3;\n alpha?: number;\n /**\n * Optional 4×5 color matrix (row-major, 20 numbers) — `out = M₄ₓ₄ * in + bias`.\n * Accumulated multiplicatively down the group stack. Defaults to identity.\n */\n colorMatrix?: number[];\n /** Optional clip path. When set, the renderer rasterizes this path into\n * the stencil buffer before drawing `children`; the children paint only\n * where the clip covers. Nested groups with clips intersect — a child\n * cannot escape an ancestor's clip. Max 7 nesting levels; the renderer\n * throws if exceeded. */\n clip?: Path;\n /**\n * Full-screen passes run over this group's own pixels, in order, before it\n * is composited into its parent.\n *\n * Unlike every other field here, this does not accumulate down the group\n * stack — it is a render-target boundary. The children draw into a buffer of\n * their own, each effect reads the previous one's output, and the result is\n * composited back under this group's `transform`, `alpha`, `colorMatrix` and\n * whatever clip encloses it. So a blur here blurs this group and nothing\n * around it, which is what a CSS `filter` on the canvas cannot do.\n *\n * An empty or absent list costs nothing: no buffer is allocated until a\n * group asks for one.\n */\n effects?: readonly Effect[];\n children: DrawCommand[];\n}\n\n/**\n * Text draw command. Renders one or more runs at (`x`, `y`) in screen\n * space, optionally word-wrapping at `maxWidth`. The renderer resolves\n * each run's `(fontFamily, fontWeight, fontStyle)` to an MSDF atlas via\n * `resolveFontVariant` and bucket-draws by atlas + color group.\n *\n * `style` carries node-level defaults (`lineHeight`, anti-alias width)\n * that don't belong on individual runs.\n */\nexport interface TextDrawCommand {\n kind: 'text';\n x: number;\n y: number;\n runs: ResolvedRun[];\n /** Wrap width. Absent never wraps. */\n maxWidth?: number;\n align?: 'left' | 'center' | 'right';\n /** Spread each wrapped line across `width` — see `LayoutRunsOpts.justify`.\n * `align` then sets only the lines it does not spread. Default `false`. */\n justify?: boolean;\n /** Box width `align` resolves within, from `x`. Default `maxWidth`; with\n * neither, `x` is the line's left edge, midpoint or right edge. */\n width?: number;\n style: TextStyle;\n /** Box height for vertical alignment. When set with `verticalAlign`,\n * the laid-out block shifts within `[y, y+height]`. */\n height?: number;\n /** Default 'top' — the legacy top-anchored behavior. */\n verticalAlign?: TextVerticalAlign;\n}\n\n/**\n * Image draw command — renders `image` at screen-space rect (x, y, w, h).\n * The image is stretched to fit; no tiling. Use a pattern FillStyle on a path\n * for tiling.\n */\nexport interface ImageDrawCommand {\n kind: 'image';\n image: ImageBitmap;\n x: number;\n y: number;\n w: number;\n h: number;\n opacity?: number;\n /** Magnification filter. `'linear'` (default) smooths; `'nearest'` shows\n * device pixels as hard squares — required by anything magnifying a\n * framebuffer readback, where blur destroys the point of the readback. */\n sampling?: 'linear' | 'nearest';\n /** Sub-rectangle of `image` to draw, in bitmap pixels from the top-left.\n * Omitted draws the whole bitmap. Not range-checked: a rect past the edge\n * samples outside [0..1], which CLAMP_TO_EDGE smears. With\n * `sampling: 'linear'` the filter reaches half a texel beyond `source`, so\n * atlas frames need a gutter (see `SpriteSheet.spacing`) or `'nearest'`. */\n source?: { x: number; y: number; w: number; h: number };\n /** Mirror the sampled region within the destination rect. The quad does not\n * move — a flipped draw covers exactly the pixels an unflipped one does. */\n flipX?: boolean;\n flipY?: boolean;\n}\n\n/** Floats per sprite in `SpritesDrawCommand.sprites`. */\nexport const SPRITE_STRIDE = 9;\n\n/**\n * Draw many quads sampling one bitmap — an atlas, a sprite sheet, a wall of\n * thumbnails. The same picture as a run of `ImageDrawCommand`s the renderer\n * would coalesce anyway, handed over already packed so it never walks a\n * command object per quad.\n *\n * Reach for it past a few thousand sprites. Below that a plain run of image\n * commands merges into the same single draw and reads better; the packed form\n * exists because at 20,000 the object walk is about half the frame.\n *\n * The sprites are one run: they share a texture, a filter, and whatever group\n * transform, alpha, color matrix and clip are live, exactly as a merged run of\n * image commands would. Anything varying per sprite is in the array.\n */\nexport interface SpritesDrawCommand {\n kind: 'sprites';\n image: ImageBitmap;\n /** Magnification filter for the whole run, as `ImageDrawCommand.sampling`. */\n sampling?: 'linear' | 'nearest';\n /**\n * `SPRITE_STRIDE` floats per sprite:\n * `dx, dy, dw, dh, sx, sy, sw, sh, opacity`.\n *\n * Destination is in the group's coordinates; source is in bitmap pixels,\n * like `ImageDrawCommand.source`. A negative `sw` or `sh` mirrors that axis\n * within the source rect, which is what `flipX` / `flipY` do. A trailing\n * partial sprite is ignored.\n */\n sprites: Float32Array;\n}\n\n/**\n * Custom shader draw command. The renderer generates a quad over `bounds`\n * and dispatches the consumer's fragment shader with the kit's vertex prelude.\n *\n * `uniforms` keys must match names declared in the consumer's fragment shader.\n * The kit automatically sets `u_bounds`, `u_view`, and `u_proj` — do not\n * declare those in `uniforms`.\n *\n * @experimental API may change before v2.\n */\nexport interface ShaderDrawCommand {\n kind: 'shader';\n program: ShaderProgramHandle;\n uniforms: Record<string, ShaderUniform>;\n /** Screen-space bounding rect in CSS pixels. */\n bounds: { x: number; y: number; w: number; h: number };\n}\n"],"mappings":";AA6JA,IAAaA,IAAgB"}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { createPaintResources as e } from "./paintResources.js";
|
|
2
|
+
import { ShaderProgram as t } from "./shaders/ShaderProgram.js";
|
|
3
|
+
import { FRAG_SRC as n, PATH_FILL_ATTRIBUTES as r, PATH_FILL_UNIFORMS as i, PATH_FILL_VCOLOR_ATTRIBUTES as a, VCOLOR_FRAG_SRC as o, VCOLOR_VERT_SRC as s, VERT_SRC as c } from "./shaders/pathFill.js";
|
|
4
|
+
import { IMAGE_FILL_ATTRIBUTES as l, IMAGE_FILL_UNIFORMS as u, IMAGE_FRAG_SRC as d, IMAGE_VERT_SRC as f } from "./shaders/imageFill.js";
|
|
5
|
+
import { BATCH_FILL_ATTRIBUTES as p, BATCH_FILL_UNIFORMS as m, BATCH_FRAG_SRC as h, BATCH_VERT_SRC as g } from "./shaders/batchFill.js";
|
|
6
|
+
import { GRAD_FILL_ATTRIBUTES as _, GRAD_FILL_UNIFORMS as v, GRAD_FRAG_SRC as y, GRAD_VERT_SRC as b } from "./shaders/gradFill.js";
|
|
7
|
+
import { PATTERN_FILL_ATTRIBUTES as x, PATTERN_FILL_UNIFORMS as S, PATTERN_FRAG_SRC as C, PATTERN_VERT_SRC as w } from "./shaders/patternFill.js";
|
|
8
|
+
import { GLYPH_GRAD_FRAG_SRC as T, GLYPH_GRAD_UNIFORMS as E, GLYPH_PAINT_ATTRIBUTES as D, GLYPH_PAINT_VERT_SRC as O, GLYPH_PATTERN_FRAG_SRC as k, GLYPH_PATTERN_UNIFORMS as A, GLYPH_TEXTURE_FRAG_SRC as j, GLYPH_TEXTURE_UNIFORMS as ee } from "./shaders/glyphPaint.js";
|
|
9
|
+
import { PaintScratch as te } from "./paintScratch.js";
|
|
10
|
+
import { GLMeshCache as M } from "./cache/GLMeshCache.js";
|
|
11
|
+
import { GLTextureCache as N } from "./cache/GLTextureCache.js";
|
|
12
|
+
import { GLImageCache as P } from "./cache/GLImageCache.js";
|
|
13
|
+
import { GradientRampAtlas as F } from "./cache/GradientRampAtlas.js";
|
|
14
|
+
import { GroupState as I } from "./state/GroupState.js";
|
|
15
|
+
import { getProgramSource as L } from "./shaders/registerProgram.js";
|
|
16
|
+
import { DrawBatch as R } from "./drawBatch.js";
|
|
17
|
+
import { OUTLINE_MIN_SCREEN_PX as ne, dispatch as z, flushBatch as B } from "./draw.js";
|
|
18
|
+
import { CUSTOM_ATTRIBUTES as V, CUSTOM_KIT_UNIFORMS as H, CUSTOM_VERT_SRC as U, QUAD_INDICES as W, QUAD_VERTICES as G } from "./shaders/customPrelude.js";
|
|
19
|
+
import { EffectTargets as K } from "./effects/EffectTargets.js";
|
|
20
|
+
import { extractUniformArrays as q, extractUniformNames as J } from "./shaders/extractUniformNames.js";
|
|
21
|
+
import { DEFAULT_BAKE_BUDGET as Y, markAllFontsNotUploaded as X, resetBakeBudget as re } from "@weasel-js/font";
|
|
22
|
+
//#region src/renderer/WeaselRenderer.ts
|
|
23
|
+
function ie(e, t) {
|
|
24
|
+
return [
|
|
25
|
+
...H,
|
|
26
|
+
...J(e),
|
|
27
|
+
...J(t)
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
function Z(e, n) {
|
|
31
|
+
let r = n.vert === "" ? U : n.vert, i = new t(e, r, n.frag);
|
|
32
|
+
return i.lookupUniforms(ie(r, n.frag)), i.lookupUniformArrays(new Map([...q(r), ...q(n.frag)])), i.lookupAttributes(V), i;
|
|
33
|
+
}
|
|
34
|
+
function Q() {
|
|
35
|
+
return typeof performance < "u" ? performance.now() : Date.now();
|
|
36
|
+
}
|
|
37
|
+
var ae = {
|
|
38
|
+
pattern: [k, A],
|
|
39
|
+
gradient: [T, E],
|
|
40
|
+
texture: [j, ee]
|
|
41
|
+
}, oe = class {
|
|
42
|
+
gl;
|
|
43
|
+
stats = {
|
|
44
|
+
drawCalls: 0,
|
|
45
|
+
ms: 0,
|
|
46
|
+
spans: []
|
|
47
|
+
};
|
|
48
|
+
pathFill;
|
|
49
|
+
pathFillVColor;
|
|
50
|
+
imageFill;
|
|
51
|
+
batchFill;
|
|
52
|
+
gradFill;
|
|
53
|
+
patternFill;
|
|
54
|
+
glyphPaintPrograms = /* @__PURE__ */ new Map();
|
|
55
|
+
meshCache;
|
|
56
|
+
textureCache;
|
|
57
|
+
imageCache;
|
|
58
|
+
gradRamps;
|
|
59
|
+
programRegistry = /* @__PURE__ */ new Map();
|
|
60
|
+
programSources = /* @__PURE__ */ new Map();
|
|
61
|
+
quadVbo = null;
|
|
62
|
+
quadIbo = null;
|
|
63
|
+
drawBatch;
|
|
64
|
+
whiteTexture = null;
|
|
65
|
+
groupState = new I();
|
|
66
|
+
widthCss;
|
|
67
|
+
heightCss;
|
|
68
|
+
dpr;
|
|
69
|
+
canvas = null;
|
|
70
|
+
target = null;
|
|
71
|
+
effectTargets;
|
|
72
|
+
paintScratch;
|
|
73
|
+
imageMinification;
|
|
74
|
+
flattenTolerance;
|
|
75
|
+
bakeBudget;
|
|
76
|
+
textOutlineMinScreenSize;
|
|
77
|
+
contextLost = !1;
|
|
78
|
+
boundOnLost = (e) => this.onContextLost(e);
|
|
79
|
+
boundOnRestored = () => this.onContextRestored();
|
|
80
|
+
disposed = !1;
|
|
81
|
+
paintResources = e();
|
|
82
|
+
constructor(e) {
|
|
83
|
+
if (!e.gl && !e.canvas) throw Error("WeaselRenderer requires either gl or canvas");
|
|
84
|
+
let T = e.gl ?? e.canvas.getContext("webgl2", { stencil: !0 });
|
|
85
|
+
if (!T) throw Error("WeaselRenderer: WebGL2 not available");
|
|
86
|
+
this.gl = T, this.effectTargets = new K(this.gl), this.paintScratch = new te(this.gl);
|
|
87
|
+
let E = typeof this.gl.getContextAttributes == "function" ? this.gl.getContextAttributes() : null;
|
|
88
|
+
if (E && E.stencil === !1) throw Error("WeaselRenderer: the supplied WebGL2 context has no stencil buffer. Create it with { stencil: true } — clips and even-odd fills need one.");
|
|
89
|
+
this.widthCss = e.width, this.heightCss = e.height, this.dpr = e.dpr, this.imageMinification = e.imageMinification ?? "linear", this.flattenTolerance = e.flattenTolerance, this.bakeBudget = e.bakeBudget ?? Y, this.textOutlineMinScreenSize = e.textOutlineMinScreenSize ?? ne, this.canvas = e.canvas ?? null, this.canvas && (this.canvas.width = Math.round(e.width * e.dpr), this.canvas.height = Math.round(e.height * e.dpr), this.canvas.style && (this.canvas.style.width = `${e.width}px`, this.canvas.style.height = `${e.height}px`), this.canvas.addEventListener("webglcontextlost", this.boundOnLost), this.canvas.addEventListener("webglcontextrestored", this.boundOnRestored)), this.applyGlState(), this.applyTarget(), this.pathFill = new t(this.gl, c, n), this.pathFill.lookupUniforms(i), this.pathFill.lookupAttributes(r), this.pathFillVColor = new t(this.gl, s, o), this.pathFillVColor.lookupUniforms(i), this.pathFillVColor.lookupAttributes(a), this.imageFill = new t(this.gl, f, d), this.imageFill.lookupUniforms(u), this.imageFill.lookupAttributes(l), this.batchFill = new t(this.gl, g, h), this.batchFill.lookupUniforms(m), this.batchFill.lookupAttributes(p), this.gradFill = new t(this.gl, b, y), this.gradFill.lookupUniforms(v), this.gradFill.lookupAttributes(_), this.patternFill = new t(this.gl, w, C), this.patternFill.lookupUniforms(S), this.patternFill.lookupAttributes(x);
|
|
90
|
+
let D = this.pathFill.attribute("a_position");
|
|
91
|
+
if (D === void 0) throw Error("WeaselRenderer: a_position not found in path-fill shader");
|
|
92
|
+
this.meshCache = new M(this.gl, D), this.textureCache = new N(this.gl), this.imageCache = new P(this.gl, this.imageMinification), this.gradRamps = new F(this.gl), this.uploadQuadGeometry(), this.drawBatch = new R(this.gl, this.batchFill), this.whiteTexture = $(this.gl);
|
|
93
|
+
}
|
|
94
|
+
uploadQuadGeometry() {
|
|
95
|
+
let e = this.gl;
|
|
96
|
+
if (this.quadVbo = e.createBuffer(), this.quadIbo = e.createBuffer(), !this.quadVbo || !this.quadIbo) throw Error("WeaselRenderer: failed to create quad geometry buffers");
|
|
97
|
+
e.bindBuffer(e.ARRAY_BUFFER, this.quadVbo), e.bufferData(e.ARRAY_BUFFER, G, e.STATIC_DRAW), e.bindBuffer(e.ARRAY_BUFFER, null), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.quadIbo), e.bufferData(e.ELEMENT_ARRAY_BUFFER, W, e.STATIC_DRAW), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, null);
|
|
98
|
+
}
|
|
99
|
+
registerProgram(e) {
|
|
100
|
+
if (this.disposed) return;
|
|
101
|
+
let t = L(e.id);
|
|
102
|
+
if (!t) throw Error(`WeaselRenderer.registerProgram: program "${e.id}" not found in source registry. Call the module-level registerProgram() first.`);
|
|
103
|
+
this.installProgram(e.id, t, Z(this.gl, t));
|
|
104
|
+
}
|
|
105
|
+
installProgram(e, t, n) {
|
|
106
|
+
let r = this.programRegistry.get(e);
|
|
107
|
+
r && this.gl.deleteProgram(r.handle), this.programRegistry.set(e, n), this.programSources.set(e, t);
|
|
108
|
+
}
|
|
109
|
+
refreshPrograms() {
|
|
110
|
+
for (let [e, t] of this.programSources) {
|
|
111
|
+
let n = L(e);
|
|
112
|
+
if (n && n !== t) {
|
|
113
|
+
if (n.vert === t.vert && n.frag === t.frag) {
|
|
114
|
+
this.programSources.set(e, n);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
this.installProgram(e, n, Z(this.gl, n));
|
|
119
|
+
} catch (t) {
|
|
120
|
+
this.programSources.set(e, n), console.error(`weasel: failed to recompile re-registered program "${e}"; still drawing the previous one:`, t);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
ensureProgram(e) {
|
|
126
|
+
let t = this.programRegistry.get(e);
|
|
127
|
+
if (t) return t;
|
|
128
|
+
if (this.disposed || !L(e)) return null;
|
|
129
|
+
try {
|
|
130
|
+
this.registerProgram({ id: e });
|
|
131
|
+
} catch (t) {
|
|
132
|
+
return console.error(`weasel: failed to compile paint program "${e}":`, t), null;
|
|
133
|
+
}
|
|
134
|
+
return this.programRegistry.get(e) ?? null;
|
|
135
|
+
}
|
|
136
|
+
glyphPaintProgram(e) {
|
|
137
|
+
let n = this.glyphPaintPrograms.get(e);
|
|
138
|
+
if (n) return n;
|
|
139
|
+
let [r, i] = ae[e], a = new t(this.gl, O, r);
|
|
140
|
+
return a.lookupUniforms(i), a.lookupAttributes(D), this.glyphPaintPrograms.set(e, a), a;
|
|
141
|
+
}
|
|
142
|
+
applyGlState() {
|
|
143
|
+
let e = this.gl;
|
|
144
|
+
e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), e.disable(e.DEPTH_TEST), e.disable(e.CULL_FACE), e.clearColor(0, 0, 0, 0);
|
|
145
|
+
}
|
|
146
|
+
applyTarget() {
|
|
147
|
+
let e = this.gl, t = Math.round(this.widthCss * this.dpr), n = Math.round(this.heightCss * this.dpr);
|
|
148
|
+
if (!this.target) {
|
|
149
|
+
e.disable(e.SCISSOR_TEST), e.viewport(0, 0, t, n);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
let r = Math.round(this.target.origin.x * this.dpr), i = e.drawingBufferHeight - Math.round(this.target.origin.y * this.dpr) - n;
|
|
153
|
+
e.viewport(r, i, t, n), e.scissor(r, i, t, n), e.enable(e.SCISSOR_TEST);
|
|
154
|
+
}
|
|
155
|
+
setTarget(e) {
|
|
156
|
+
this.target = e, this.applyTarget();
|
|
157
|
+
}
|
|
158
|
+
getTarget() {
|
|
159
|
+
return this.target;
|
|
160
|
+
}
|
|
161
|
+
isContextLost() {
|
|
162
|
+
return this.contextLost;
|
|
163
|
+
}
|
|
164
|
+
onContextLost(e) {
|
|
165
|
+
e.preventDefault(), this.contextLost = !0;
|
|
166
|
+
}
|
|
167
|
+
onContextRestored() {
|
|
168
|
+
this.contextLost = !1, this.applyGlState(), this.applyTarget(), this.effectTargets.releaseAll(), this.paintScratch.release(), this.paintResources.release(), this.paintResources = e(), this.pathFill = new t(this.gl, c, n), this.pathFill.lookupUniforms(i), this.pathFill.lookupAttributes(r), this.pathFillVColor = new t(this.gl, s, o), this.pathFillVColor.lookupUniforms(i), this.pathFillVColor.lookupAttributes(a), this.imageFill = new t(this.gl, f, d), this.imageFill.lookupUniforms(u), this.imageFill.lookupAttributes(l), this.batchFill = new t(this.gl, g, h), this.batchFill.lookupUniforms(m), this.batchFill.lookupAttributes(p), this.gradFill = new t(this.gl, b, y), this.gradFill.lookupUniforms(v), this.gradFill.lookupAttributes(_), this.patternFill = new t(this.gl, w, C), this.patternFill.lookupUniforms(S), this.patternFill.lookupAttributes(x), this.glyphPaintPrograms.clear();
|
|
169
|
+
let T = this.pathFill.attribute("a_position");
|
|
170
|
+
if (T === void 0) throw Error("a_position missing after restore");
|
|
171
|
+
this.meshCache = new M(this.gl, T), this.textureCache = new N(this.gl), this.imageCache.abandon(), this.imageCache = new P(this.gl, this.imageMinification), this.gradRamps = new F(this.gl), X(), this.uploadQuadGeometry(), this.drawBatch = new R(this.gl, this.batchFill), this.whiteTexture = $(this.gl);
|
|
172
|
+
for (let e of this.programRegistry.keys()) {
|
|
173
|
+
let t = L(e);
|
|
174
|
+
if (t) try {
|
|
175
|
+
this.programRegistry.set(e, Z(this.gl, t)), this.programSources.set(e, t);
|
|
176
|
+
} catch (t) {
|
|
177
|
+
console.error(`weasel: failed to recompile program "${e}" after context restore:`, t);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
dispose() {
|
|
182
|
+
if (this.disposed) return;
|
|
183
|
+
this.disposed = !0;
|
|
184
|
+
let e = this.gl;
|
|
185
|
+
this.canvas && (this.canvas.removeEventListener("webglcontextlost", this.boundOnLost), this.canvas.removeEventListener("webglcontextrestored", this.boundOnRestored)), this.meshCache.dispose(), this.paintResources.release();
|
|
186
|
+
for (let t of [
|
|
187
|
+
this.pathFill,
|
|
188
|
+
this.pathFillVColor,
|
|
189
|
+
this.imageFill,
|
|
190
|
+
this.batchFill,
|
|
191
|
+
this.gradFill,
|
|
192
|
+
this.patternFill,
|
|
193
|
+
...this.glyphPaintPrograms.values()
|
|
194
|
+
]) e.deleteProgram(t.handle);
|
|
195
|
+
this.glyphPaintPrograms.clear();
|
|
196
|
+
for (let t of this.programRegistry.values()) e.deleteProgram(t.handle);
|
|
197
|
+
this.programRegistry.clear(), this.programSources.clear(), this.textureCache.free(), this.imageCache.dispose(), this.gradRamps.free(), this.quadVbo && e.deleteBuffer(this.quadVbo), this.quadIbo && e.deleteBuffer(this.quadIbo), this.drawBatch.dispose(), this.whiteTexture && e.deleteTexture(this.whiteTexture), this.whiteTexture = null, this.effectTargets.releaseAll(), this.paintScratch.release();
|
|
198
|
+
}
|
|
199
|
+
render(e, t, n) {
|
|
200
|
+
if (this.contextLost || this.disposed) return;
|
|
201
|
+
let r = Q(), i = { drawCalls: 0 }, a = [];
|
|
202
|
+
this.stats = {
|
|
203
|
+
drawCalls: 0,
|
|
204
|
+
ms: 0,
|
|
205
|
+
spans: a
|
|
206
|
+
};
|
|
207
|
+
let o = this.gl;
|
|
208
|
+
this.meshCache.drainPendingDeletes(), this.refreshPrograms(), re(this.bakeBudget), this.groupState.reset(), this.applyGlState(), this.applyTarget(), this.target?.clear !== !1 && (o.stencilMask(255), o.clear(o.COLOR_BUFFER_BIT | o.STENCIL_BUFFER_BIT));
|
|
209
|
+
let s = {
|
|
210
|
+
gl: o,
|
|
211
|
+
pathFill: this.pathFill,
|
|
212
|
+
pathFillVColor: this.pathFillVColor,
|
|
213
|
+
imageFill: this.imageFill,
|
|
214
|
+
batchFill: this.batchFill,
|
|
215
|
+
gradFill: this.gradFill,
|
|
216
|
+
patternFill: this.patternFill,
|
|
217
|
+
meshCache: this.meshCache,
|
|
218
|
+
textureCache: this.textureCache,
|
|
219
|
+
imageCache: this.imageCache,
|
|
220
|
+
gradRamps: this.gradRamps,
|
|
221
|
+
programRegistry: this.programRegistry,
|
|
222
|
+
ensureProgram: (e) => this.ensureProgram(e),
|
|
223
|
+
glyphPaintProgram: (e) => this.glyphPaintProgram(e),
|
|
224
|
+
quadVbo: this.quadVbo,
|
|
225
|
+
quadIbo: this.quadIbo,
|
|
226
|
+
drawBatch: this.drawBatch,
|
|
227
|
+
whiteTexture: this.whiteTexture,
|
|
228
|
+
state: this.groupState,
|
|
229
|
+
widthCss: this.widthCss,
|
|
230
|
+
heightCss: this.heightCss,
|
|
231
|
+
clipDepth: 0,
|
|
232
|
+
flattenTolerance: this.flattenTolerance,
|
|
233
|
+
textOutlineMinScreenSize: this.textOutlineMinScreenSize,
|
|
234
|
+
viewMatrix: t,
|
|
235
|
+
effectTargets: this.effectTargets,
|
|
236
|
+
paintScratch: this.paintScratch,
|
|
237
|
+
renderTarget: null,
|
|
238
|
+
deviceWidth: Math.round(this.widthCss * this.dpr),
|
|
239
|
+
deviceHeight: Math.round(this.heightCss * this.dpr),
|
|
240
|
+
restoreTargetRect: () => this.applyTarget(),
|
|
241
|
+
paintResources: this.paintResources,
|
|
242
|
+
stats: i
|
|
243
|
+
}, c = n?.spans ?? [], l = 0;
|
|
244
|
+
for (let t = 0; t < c.length; t++) {
|
|
245
|
+
let n = c[t];
|
|
246
|
+
for (; l < n.start; l++) z(s, e[l]);
|
|
247
|
+
let r = i.drawCalls, o = Q();
|
|
248
|
+
for (; l < n.end; l++) z(s, e[l]);
|
|
249
|
+
t === c.length - 1 && l >= e.length && B(s), a.push({
|
|
250
|
+
id: n.id,
|
|
251
|
+
drawCalls: i.drawCalls - r,
|
|
252
|
+
ms: Q() - o
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
for (; l < e.length; l++) z(s, e[l]);
|
|
256
|
+
B(s), this.meshCache.freeTransient(), this.stats.drawCalls = i.drawCalls, this.stats.ms = Q() - r;
|
|
257
|
+
}
|
|
258
|
+
lastFrameStats() {
|
|
259
|
+
return this.stats;
|
|
260
|
+
}
|
|
261
|
+
setFlattenTolerance(e) {
|
|
262
|
+
this.flattenTolerance = e;
|
|
263
|
+
}
|
|
264
|
+
resize(e) {
|
|
265
|
+
this.widthCss = e.width, this.heightCss = e.height, this.dpr = e.dpr, this.canvas && (this.canvas.width = Math.round(e.width * e.dpr), this.canvas.height = Math.round(e.height * e.dpr), this.canvas.style && (this.canvas.style.width = `${e.width}px`, this.canvas.style.height = `${e.height}px`)), this.applyTarget();
|
|
266
|
+
}
|
|
267
|
+
_gl() {
|
|
268
|
+
return this.gl;
|
|
269
|
+
}
|
|
270
|
+
_pathFill() {
|
|
271
|
+
return this.pathFill;
|
|
272
|
+
}
|
|
273
|
+
_pathFillVColor() {
|
|
274
|
+
return this.pathFillVColor;
|
|
275
|
+
}
|
|
276
|
+
_drawBatch() {
|
|
277
|
+
return this.drawBatch;
|
|
278
|
+
}
|
|
279
|
+
_imageFill() {
|
|
280
|
+
return this.imageFill;
|
|
281
|
+
}
|
|
282
|
+
_batchFill() {
|
|
283
|
+
return this.batchFill;
|
|
284
|
+
}
|
|
285
|
+
_gradFill() {
|
|
286
|
+
return this.gradFill;
|
|
287
|
+
}
|
|
288
|
+
_patternFill() {
|
|
289
|
+
return this.patternFill;
|
|
290
|
+
}
|
|
291
|
+
_meshCache() {
|
|
292
|
+
return this.meshCache;
|
|
293
|
+
}
|
|
294
|
+
_textureCache() {
|
|
295
|
+
return this.textureCache;
|
|
296
|
+
}
|
|
297
|
+
_imageCache() {
|
|
298
|
+
return this.imageCache;
|
|
299
|
+
}
|
|
300
|
+
_gradRamps() {
|
|
301
|
+
return this.gradRamps;
|
|
302
|
+
}
|
|
303
|
+
_groupState() {
|
|
304
|
+
return this.groupState;
|
|
305
|
+
}
|
|
306
|
+
_widthCss() {
|
|
307
|
+
return this.widthCss;
|
|
308
|
+
}
|
|
309
|
+
_heightCss() {
|
|
310
|
+
return this.heightCss;
|
|
311
|
+
}
|
|
312
|
+
_dpr() {
|
|
313
|
+
return this.dpr;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
function $(e) {
|
|
317
|
+
let t = e.createTexture();
|
|
318
|
+
return t ? (e.bindTexture(e.TEXTURE_2D, t), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([
|
|
319
|
+
255,
|
|
320
|
+
255,
|
|
321
|
+
255,
|
|
322
|
+
255
|
|
323
|
+
])), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.bindTexture(e.TEXTURE_2D, null), t) : null;
|
|
324
|
+
}
|
|
325
|
+
//#endregion
|
|
326
|
+
export { oe as WeaselRenderer };
|
|
327
|
+
|
|
328
|
+
//# sourceMappingURL=WeaselRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeaselRenderer.js","names":["customUniformNames","CUSTOM_KIT_UNIFORMS","extractUniformNames","vertSrc","fragSrc","compileCustomProgram","src","CUSTOM_VERT_SRC","program","ShaderProgram","gl","extractUniformArrays","CUSTOM_ATTRIBUTES","now","GLYPH_PAINT_SOURCES","GLYPH_PATTERN_FRAG_SRC","GLYPH_PATTERN_UNIFORMS","GLYPH_GRAD_FRAG_SRC","GLYPH_GRAD_UNIFORMS","GLYPH_TEXTURE_FRAG_SRC","GLYPH_TEXTURE_UNIFORMS","WeaselRenderer","GroupState","createPaintResources","opts","EffectTargets","PaintScratch","attrs","DEFAULT_BAKE_BUDGET","OUTLINE_MIN_SCREEN_PX","VERT_SRC","FRAG_SRC","PATH_FILL_UNIFORMS","PATH_FILL_ATTRIBUTES","VCOLOR_VERT_SRC","VCOLOR_FRAG_SRC","PATH_FILL_VCOLOR_ATTRIBUTES","IMAGE_VERT_SRC","IMAGE_FRAG_SRC","IMAGE_FILL_UNIFORMS","IMAGE_FILL_ATTRIBUTES","BATCH_VERT_SRC","BATCH_FRAG_SRC","BATCH_FILL_UNIFORMS","BATCH_FILL_ATTRIBUTES","GRAD_VERT_SRC","GRAD_FRAG_SRC","GRAD_FILL_UNIFORMS","GRAD_FILL_ATTRIBUTES","PATTERN_VERT_SRC","PATTERN_FRAG_SRC","PATTERN_FILL_UNIFORMS","PATTERN_FILL_ATTRIBUTES","aPos","GLMeshCache","GLTextureCache","GLImageCache","GradientRampAtlas","DrawBatch","createWhiteTexture","QUAD_VERTICES","QUAD_INDICES","getProgramSource","handle","previous","id","compiled","e","existing","kind","frag","uniforms","GLYPH_PAINT_VERT_SRC","GLYPH_PAINT_ATTRIBUTES","w","h","x","y","target","markAllFontsNotUploaded","prog","t0","counters","spanStats","resetBakeBudget","ctx","spans","next","si","span","commands","drawsBefore","spanT0","flushBatch","tolerance","dims","tex"],"sources":["../../src/renderer/WeaselRenderer.ts"],"sourcesContent":["import { createPaintResources, type OwnedPaintResources } from './paintResources';\nimport { ShaderProgram } from './shaders/ShaderProgram';\nimport {\n VERT_SRC,\n FRAG_SRC,\n VCOLOR_VERT_SRC,\n VCOLOR_FRAG_SRC,\n PATH_FILL_UNIFORMS,\n PATH_FILL_ATTRIBUTES,\n PATH_FILL_VCOLOR_ATTRIBUTES,\n} from './shaders/pathFill';\nimport {\n markAllFontsNotUploaded,\n resetBakeBudget,\n DEFAULT_BAKE_BUDGET,\n} from '@weasel-js/font';\nimport {\n IMAGE_VERT_SRC,\n IMAGE_FRAG_SRC,\n IMAGE_FILL_UNIFORMS,\n IMAGE_FILL_ATTRIBUTES,\n} from './shaders/imageFill';\nimport {\n BATCH_VERT_SRC,\n BATCH_FRAG_SRC,\n BATCH_FILL_UNIFORMS,\n BATCH_FILL_ATTRIBUTES,\n} from './shaders/batchFill';\nimport {\n GRAD_VERT_SRC,\n GRAD_FRAG_SRC,\n GRAD_FILL_UNIFORMS,\n GRAD_FILL_ATTRIBUTES,\n} from './shaders/gradFill';\nimport {\n PATTERN_VERT_SRC,\n PATTERN_FRAG_SRC,\n PATTERN_FILL_UNIFORMS,\n PATTERN_FILL_ATTRIBUTES,\n} from './shaders/patternFill';\nimport {\n GLYPH_PAINT_VERT_SRC,\n GLYPH_PATTERN_FRAG_SRC,\n GLYPH_GRAD_FRAG_SRC,\n GLYPH_TEXTURE_FRAG_SRC,\n GLYPH_PATTERN_UNIFORMS,\n GLYPH_GRAD_UNIFORMS,\n GLYPH_TEXTURE_UNIFORMS,\n GLYPH_PAINT_ATTRIBUTES,\n} from './shaders/glyphPaint';\nimport { PaintScratch } from './paintScratch';\nimport { GLMeshCache } from './cache/GLMeshCache';\nimport { GLTextureCache } from './cache/GLTextureCache';\nimport { GLImageCache, type ImageMinification } from './cache/GLImageCache';\nimport { GradientRampAtlas } from './cache/GradientRampAtlas';\nimport { GroupState } from './state/GroupState';\nimport type { DrawCommand } from './DrawCommand';\nimport type { GlMat3 } from './math/mat3';\nimport {\n dispatch, flushBatch, OUTLINE_MIN_SCREEN_PX, type DrawContext, type GlyphPaintKind,\n} from './draw';\nimport { DrawBatch } from './drawBatch';\nimport {\n CUSTOM_VERT_SRC, CUSTOM_ATTRIBUTES, CUSTOM_KIT_UNIFORMS,\n QUAD_VERTICES, QUAD_INDICES,\n} from './shaders/customPrelude';\nimport { getProgramSource, type ProgramSource, type ShaderProgramHandle } from './shaders/registerProgram';\nimport { EffectTargets } from './effects/EffectTargets';\nimport { extractUniformArrays, extractUniformNames } from './shaders/extractUniformNames';\n\n/** Every uniform a custom program may be written through. Both stages, not\n * just the fragment one: a name never looked up is written through `null`,\n * which GL accepts silently, so the uniform keeps its zero default. */\nfunction customUniformNames(vertSrc: string, fragSrc: string): string[] {\n return [...CUSTOM_KIT_UNIFORMS, ...extractUniformNames(vertSrc), ...extractUniformNames(fragSrc)];\n}\n\n/** Compile a registered program's source against `gl`, with every uniform\n * location and array base it may be written through. */\nfunction compileCustomProgram(gl: WebGL2RenderingContext, src: ProgramSource): ShaderProgram {\n const vertSrc = src.vert === '' ? CUSTOM_VERT_SRC : src.vert;\n const program = new ShaderProgram(gl, vertSrc, src.frag);\n program.lookupUniforms(customUniformNames(vertSrc, src.frag));\n program.lookupUniformArrays(new Map([...extractUniformArrays(vertSrc), ...extractUniformArrays(src.frag)]));\n program.lookupAttributes(CUSTOM_ATTRIBUTES);\n return program;\n}\n\n/** How to construct a `WeaselRenderer`: the GL context or canvas to draw\n * into, the output size, and the quality knobs that separate screen\n * rendering from print. */\n/** A run of top-level commands, `[start, end)` by index, that\n * {@link WeaselRenderer.lastFrameStats} accounts for separately — one render\n * layer's commands, say. Spans are in order and do not overlap. */\nexport interface RenderSpan {\n id: string;\n start: number;\n end: number;\n}\n\n/** Per-frame options for {@link WeaselRenderer.render}. */\nexport interface RenderOptions {\n spans?: readonly RenderSpan[];\n}\n\n/** What one span cost. A batched run is drawn when something closes it, so\n * its draw call counts toward the span that closed it. */\nexport interface RenderSpanStats {\n id: string;\n drawCalls: number;\n ms: number;\n}\n\n/** What one `render()` cost. See {@link WeaselRenderer.lastFrameStats}. */\nexport interface RenderStats {\n drawCalls: number;\n ms: number;\n spans: RenderSpanStats[];\n}\n\nfunction now(): number {\n return typeof performance !== 'undefined' ? performance.now() : Date.now();\n}\n\n/** Construction options for {@link WeaselRenderer}. Pass `gl` or `canvas`;\n * a context passed in must have a stencil buffer. */\nexport interface WeaselRendererOptions {\n /** A WebGL2 context to draw with. Wins over `canvas`. */\n gl?: WebGL2RenderingContext;\n /** A canvas to open a stencil-backed WebGL2 context on, when `gl` is absent. */\n canvas?: HTMLCanvasElement;\n /** Drawing size in CSS pixels. */\n width: number;\n /** Drawing size in CSS pixels. */\n height: number;\n /** Device pixels per CSS pixel. */\n dpr: number;\n /** MIN_FILTER strategy for image/pattern textures (`GLImageCache`).\n * Default `'linear'` — the existing screen behavior. The headless\n * `renderSceneToPixels` path passes `'mipmap'` for print-quality\n * minification. Explicitly passing `'linear'` is always valid. */\n imageMinification?: ImageMinification;\n /** Flatness tolerance for curve tessellation, in WORLD units (see\n * `TessellateOptions.flattenTolerance`). When set, path fills are\n * tessellated fresh at this tolerance per frame (transient pool) instead\n * of served from the Path-identity mesh cache — the cache key does not\n * include tolerance. Default: unset — the existing cached behavior at\n * `DEFAULT_FLATTEN_TOLERANCE`. The headless path derives this from the\n * requested output scale; screen callers normally leave it unset. */\n flattenTolerance?: number;\n /** Per-render synchronous bake budget for dynamic canvas-SDF glyphs.\n * Default DEFAULT_BAKE_BUDGET (16). The headless renderSceneToPixels\n * path passes Infinity so print never defers a glyph. */\n bakeBudget?: number;\n /** On-screen glyph size, in CSS pixels, at or above which text renders from\n * tessellated font outlines instead of a distance field — see\n * `OUTLINE_MIN_SCREEN_PX`. Only faces registered with\n * `registerFontOutlines` are affected; everything else keeps its SDF tier\n * whatever this says. Pass `Infinity` to disable the tier outright, or 0\n * to use outlines wherever they exist (what the headless path does, since\n * print has no reason to sample a field it could evaluate exactly). */\n textOutlineMinScreenSize?: number;\n}\n\n/** Where a renderer draws inside a buffer it does not own.\n *\n * The rect's SIZE is the renderer's own `width`/`height` — `resize()` owns\n * that, and a second copy here could disagree with the one `DrawContext`\n * reports to screen-space layers. */\nexport interface RenderTarget {\n /** Top-left of this renderer's output within the drawing buffer, in CSS\n * pixels, with the origin at the buffer's top-left. GL's bottom-left origin\n * is handled internally. */\n origin: { x: number; y: number };\n /** Clear colour and stencil within the rect before drawing. Default true.\n * Pass false only when the caller clears the whole buffer itself on behalf\n * of every co-tenant — a frame that clears neither inherits its neighbour's\n * stencil bits, and even-odd fills then fill their holes. */\n clear?: boolean;\n}\n\n/** Each glyph-paint program's fragment stage and the uniforms it looks up. */\nconst GLYPH_PAINT_SOURCES: Record<GlyphPaintKind, readonly [string, readonly string[]]> = {\n pattern: [GLYPH_PATTERN_FRAG_SRC, GLYPH_PATTERN_UNIFORMS],\n gradient: [GLYPH_GRAD_FRAG_SRC, GLYPH_GRAD_UNIFORMS],\n texture: [GLYPH_TEXTURE_FRAG_SRC, GLYPH_TEXTURE_UNIFORMS],\n};\n\n/**\n * The WebGL2 renderer: takes a list of draw commands and paints them.\n *\n * It knows nothing about the scene — commands are the whole interface, which\n * is what lets layers, HUD widgets and overlays all draw through the same\n * pipeline. GPU resources (meshes, textures, gradient ramps) are cached across\n * frames and keyed by identity, so re-issuing the same command is cheap.\n */\nexport class WeaselRenderer {\n private readonly gl: WebGL2RenderingContext;\n private stats: RenderStats = { drawCalls: 0, ms: 0, spans: [] };\n private pathFill: ShaderProgram;\n private pathFillVColor: ShaderProgram;\n private imageFill: ShaderProgram;\n private batchFill: ShaderProgram;\n private gradFill: ShaderProgram;\n private patternFill: ShaderProgram;\n /** Compiled on first use: only atlas text under a texture paint needs one. */\n private glyphPaintPrograms = new Map<GlyphPaintKind, ShaderProgram>();\n private meshCache: GLMeshCache;\n private textureCache: GLTextureCache;\n private imageCache: GLImageCache;\n private gradRamps: GradientRampAtlas;\n private programRegistry = new Map<string, ShaderProgram>();\n /** The source each compiled custom program was built from — or, after a\n * failed recompile, the source that failed, so it is not retried every frame. */\n private programSources = new Map<string, ProgramSource>();\n private quadVbo: WebGLBuffer | null = null;\n private quadIbo: WebGLBuffer | null = null;\n private drawBatch: DrawBatch;\n /** 1x1 white, so a batch flush sampling no image still samples something —\n * see `shaders/batchFill.ts`. */\n private whiteTexture: WebGLTexture | null = null;\n private readonly groupState = new GroupState();\n private widthCss: number;\n private heightCss: number;\n private dpr: number;\n private canvas: HTMLCanvasElement | null = null;\n private target: RenderTarget | null = null;\n /** Offscreen buffers for group effects. Allocates nothing until a group\n * with effects asks, so a canvas without them pays no memory. */\n private readonly effectTargets: EffectTargets;\n private readonly paintScratch: PaintScratch;\n private readonly imageMinification: ImageMinification;\n private flattenTolerance?: number;\n private readonly bakeBudget: number;\n private readonly textOutlineMinScreenSize: number;\n private contextLost = false;\n private boundOnLost = (e: Event) => this.onContextLost(e);\n private boundOnRestored = () => this.onContextRestored();\n /** True after `dispose()`. A disposed renderer ignores further `render()`\n * calls and `registerProgram()` calls. */\n private disposed = false;\n /** What registered paint kinds hang their GPU state on. One per context\n * generation: a restore releases it and opens the next. */\n private paintResources: OwnedPaintResources = createPaintResources();\n\n constructor(opts: WeaselRendererOptions) {\n if (!opts.gl && !opts.canvas) {\n throw new Error('WeaselRenderer requires either gl or canvas');\n }\n const gl = opts.gl ?? opts.canvas!.getContext('webgl2', { stencil: true });\n if (!gl) throw new Error('WeaselRenderer: WebGL2 not available');\n this.gl = gl as WebGL2RenderingContext;\n this.effectTargets = new EffectTargets(this.gl);\n this.paintScratch = new PaintScratch(this.gl);\n\n // Bits 0-7 are load-bearing: bit 0 for even-odd fills and stenciled\n // strokes, bits 1-7 for clip depth (`renderer/draw.ts`). Without a stencil\n // buffer both render wrong rather than not at all, so refuse the context\n // instead of painting a plausible lie. A stub that cannot answer is not a\n // stencil-less context — only an explicit `false` is.\n const attrs = typeof this.gl.getContextAttributes === 'function'\n ? this.gl.getContextAttributes()\n : null;\n if (attrs && attrs.stencil === false) {\n throw new Error(\n 'WeaselRenderer: the supplied WebGL2 context has no stencil buffer. '\n + 'Create it with { stencil: true } — clips and even-odd fills need one.',\n );\n }\n\n this.widthCss = opts.width;\n this.heightCss = opts.height;\n this.dpr = opts.dpr;\n this.imageMinification = opts.imageMinification ?? 'linear';\n this.flattenTolerance = opts.flattenTolerance;\n this.bakeBudget = opts.bakeBudget ?? DEFAULT_BAKE_BUDGET;\n this.textOutlineMinScreenSize = opts.textOutlineMinScreenSize ?? OUTLINE_MIN_SCREEN_PX;\n\n this.canvas = opts.canvas ?? null;\n if (this.canvas) {\n this.canvas.width = Math.round(opts.width * opts.dpr);\n this.canvas.height = Math.round(opts.height * opts.dpr);\n if (this.canvas.style) {\n this.canvas.style.width = `${opts.width}px`;\n this.canvas.style.height = `${opts.height}px`;\n }\n this.canvas.addEventListener('webglcontextlost', this.boundOnLost);\n this.canvas.addEventListener('webglcontextrestored', this.boundOnRestored);\n }\n\n this.applyGlState();\n this.applyTarget();\n\n this.pathFill = new ShaderProgram(this.gl, VERT_SRC, FRAG_SRC);\n this.pathFill.lookupUniforms(PATH_FILL_UNIFORMS);\n this.pathFill.lookupAttributes(PATH_FILL_ATTRIBUTES);\n\n this.pathFillVColor = new ShaderProgram(this.gl, VCOLOR_VERT_SRC, VCOLOR_FRAG_SRC);\n this.pathFillVColor.lookupUniforms(PATH_FILL_UNIFORMS);\n this.pathFillVColor.lookupAttributes(PATH_FILL_VCOLOR_ATTRIBUTES);\n\n this.imageFill = new ShaderProgram(this.gl, IMAGE_VERT_SRC, IMAGE_FRAG_SRC);\n this.imageFill.lookupUniforms(IMAGE_FILL_UNIFORMS);\n this.imageFill.lookupAttributes(IMAGE_FILL_ATTRIBUTES);\n\n this.batchFill = new ShaderProgram(this.gl, BATCH_VERT_SRC, BATCH_FRAG_SRC);\n this.batchFill.lookupUniforms(BATCH_FILL_UNIFORMS);\n this.batchFill.lookupAttributes(BATCH_FILL_ATTRIBUTES);\n\n this.gradFill = new ShaderProgram(this.gl, GRAD_VERT_SRC, GRAD_FRAG_SRC);\n this.gradFill.lookupUniforms(GRAD_FILL_UNIFORMS);\n this.gradFill.lookupAttributes(GRAD_FILL_ATTRIBUTES);\n\n this.patternFill = new ShaderProgram(this.gl, PATTERN_VERT_SRC, PATTERN_FRAG_SRC);\n this.patternFill.lookupUniforms(PATTERN_FILL_UNIFORMS);\n this.patternFill.lookupAttributes(PATTERN_FILL_ATTRIBUTES);\n\n const aPos = this.pathFill.attribute('a_position');\n if (aPos === undefined) throw new Error('WeaselRenderer: a_position not found in path-fill shader');\n this.meshCache = new GLMeshCache(this.gl, aPos);\n this.textureCache = new GLTextureCache(this.gl);\n this.imageCache = new GLImageCache(this.gl, this.imageMinification);\n this.gradRamps = new GradientRampAtlas(this.gl);\n this.uploadQuadGeometry();\n this.drawBatch = new DrawBatch(this.gl, this.batchFill);\n this.whiteTexture = createWhiteTexture(this.gl);\n }\n\n private uploadQuadGeometry(): void {\n const gl = this.gl;\n this.quadVbo = gl.createBuffer();\n this.quadIbo = gl.createBuffer();\n if (!this.quadVbo || !this.quadIbo) {\n throw new Error('WeaselRenderer: failed to create quad geometry buffers');\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVbo);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTICES, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.quadIbo);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, QUAD_INDICES, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n }\n\n /**\n * Compile a consumer-registered shader program against this renderer's GL context.\n *\n * Call once per renderer after the module-level `registerProgram()`.\n * Throws `ShaderCompileError` if compilation fails.\n *\n * In dev mode, calling again with the same handle replaces the compiled program.\n *\n * @experimental\n */\n registerProgram(handle: ShaderProgramHandle): void {\n // A disposed renderer must not compile programs into the cleared registry.\n if (this.disposed) return;\n const src = getProgramSource(handle.id);\n if (!src) {\n throw new Error(\n `WeaselRenderer.registerProgram: program \"${handle.id}\" not found in source registry. ` +\n `Call the module-level registerProgram() first.`,\n );\n }\n this.installProgram(handle.id, src, compileCustomProgram(this.gl, src));\n }\n\n private installProgram(id: string, src: ProgramSource, program: ShaderProgram): void {\n const previous = this.programRegistry.get(id);\n if (previous) this.gl.deleteProgram(previous.handle);\n this.programRegistry.set(id, program);\n this.programSources.set(id, src);\n }\n\n /** Recompile every program whose module-level source was re-registered\n * since it was compiled. A source that fails keeps the old program drawing. */\n private refreshPrograms(): void {\n for (const [id, compiled] of this.programSources) {\n const src = getProgramSource(id);\n if (!src || src === compiled) continue;\n if (src.vert === compiled.vert && src.frag === compiled.frag) {\n this.programSources.set(id, src);\n continue;\n }\n try {\n this.installProgram(id, src, compileCustomProgram(this.gl, src));\n } catch (e) {\n this.programSources.set(id, src);\n console.error(`weasel: failed to recompile re-registered program \"${id}\"; still drawing the previous one:`, e);\n }\n }\n }\n\n /**\n * The compiled program for `id`, compiling it against this context on first\n * use. Unlike {@link registerProgram} this neither throws on a missing\n * source nor on a compile failure: a paint kind asking for a program it\n * never registered must decline the paint, not take down the frame.\n */\n private ensureProgram(id: string): ShaderProgram | null {\n const existing = this.programRegistry.get(id);\n if (existing) return existing;\n if (this.disposed || !getProgramSource(id)) return null;\n try {\n this.registerProgram({ id });\n } catch (e) {\n console.error(`weasel: failed to compile paint program \"${id}\":`, e);\n return null;\n }\n return this.programRegistry.get(id) ?? null;\n }\n\n private glyphPaintProgram(kind: GlyphPaintKind): ShaderProgram {\n const existing = this.glyphPaintPrograms.get(kind);\n if (existing) return existing;\n const [frag, uniforms] = GLYPH_PAINT_SOURCES[kind];\n const program = new ShaderProgram(this.gl, GLYPH_PAINT_VERT_SRC, frag);\n program.lookupUniforms(uniforms);\n program.lookupAttributes(GLYPH_PAINT_ATTRIBUTES);\n this.glyphPaintPrograms.set(kind, program);\n return program;\n }\n\n /** The GL state every frame assumes. Applied per `render()` rather than once\n * at construction because a co-tenant sharing this context moves all of it\n * between our frames. */\n private applyGlState(): void {\n const gl = this.gl;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.CULL_FACE);\n gl.clearColor(0, 0, 0, 0);\n }\n\n /** Viewport and scissor for this frame. Re-applied inside `render()` because\n * a co-tenant on the same context moves both between our frames. */\n private applyTarget(): void {\n const gl = this.gl;\n const w = Math.round(this.widthCss * this.dpr);\n const h = Math.round(this.heightCss * this.dpr);\n if (!this.target) {\n gl.disable(gl.SCISSOR_TEST);\n gl.viewport(0, 0, w, h);\n return;\n }\n const x = Math.round(this.target.origin.x * this.dpr);\n const y = gl.drawingBufferHeight - Math.round(this.target.origin.y * this.dpr) - h;\n gl.viewport(x, y, w, h);\n gl.scissor(x, y, w, h);\n gl.enable(gl.SCISSOR_TEST);\n }\n\n /** Confine this renderer to a rect of its drawing buffer, or pass null to\n * give it the whole buffer back. Takes effect from the next `render()`. */\n setTarget(target: RenderTarget | null): void {\n this.target = target;\n this.applyTarget();\n }\n\n getTarget(): RenderTarget | null {\n return this.target;\n }\n\n isContextLost(): boolean {\n return this.contextLost;\n }\n\n private onContextLost(e: Event): void {\n e.preventDefault();\n this.contextLost = true;\n }\n\n private onContextRestored(): void {\n this.contextLost = false;\n this.applyGlState();\n this.applyTarget();\n // Every framebuffer, texture and renderbuffer the pool held died with the\n // context. `releaseAll` deletes handles that are already gone, which is a\n // no-op, and drops the bookkeeping that would otherwise hand a dead FBO to\n // the next group with effects.\n this.effectTargets.releaseAll();\n this.paintScratch.release();\n this.paintResources.release();\n this.paintResources = createPaintResources();\n this.pathFill = new ShaderProgram(this.gl, VERT_SRC, FRAG_SRC);\n this.pathFill.lookupUniforms(PATH_FILL_UNIFORMS);\n this.pathFill.lookupAttributes(PATH_FILL_ATTRIBUTES);\n this.pathFillVColor = new ShaderProgram(this.gl, VCOLOR_VERT_SRC, VCOLOR_FRAG_SRC);\n this.pathFillVColor.lookupUniforms(PATH_FILL_UNIFORMS);\n this.pathFillVColor.lookupAttributes(PATH_FILL_VCOLOR_ATTRIBUTES); this.imageFill = new ShaderProgram(this.gl, IMAGE_VERT_SRC, IMAGE_FRAG_SRC);\n this.imageFill.lookupUniforms(IMAGE_FILL_UNIFORMS);\n this.imageFill.lookupAttributes(IMAGE_FILL_ATTRIBUTES);\n\n this.batchFill = new ShaderProgram(this.gl, BATCH_VERT_SRC, BATCH_FRAG_SRC);\n this.batchFill.lookupUniforms(BATCH_FILL_UNIFORMS);\n this.batchFill.lookupAttributes(BATCH_FILL_ATTRIBUTES);\n this.gradFill = new ShaderProgram(this.gl, GRAD_VERT_SRC, GRAD_FRAG_SRC);\n this.gradFill.lookupUniforms(GRAD_FILL_UNIFORMS);\n this.gradFill.lookupAttributes(GRAD_FILL_ATTRIBUTES);\n\n this.patternFill = new ShaderProgram(this.gl, PATTERN_VERT_SRC, PATTERN_FRAG_SRC);\n this.patternFill.lookupUniforms(PATTERN_FILL_UNIFORMS);\n this.patternFill.lookupAttributes(PATTERN_FILL_ATTRIBUTES);\n this.glyphPaintPrograms.clear();\n const aPos = this.pathFill.attribute('a_position');\n if (aPos === undefined) throw new Error('a_position missing after restore');\n this.meshCache = new GLMeshCache(this.gl, aPos);\n this.textureCache = new GLTextureCache(this.gl);\n this.imageCache.abandon();\n this.imageCache = new GLImageCache(this.gl, this.imageMinification);\n this.gradRamps = new GradientRampAtlas(this.gl);\n markAllFontsNotUploaded();\n\n this.uploadQuadGeometry();\n this.drawBatch = new DrawBatch(this.gl, this.batchFill);\n this.whiteTexture = createWhiteTexture(this.gl);\n for (const id of this.programRegistry.keys()) {\n const src = getProgramSource(id);\n if (!src) continue;\n try {\n this.programRegistry.set(id, compileCustomProgram(this.gl, src));\n this.programSources.set(id, src);\n } catch (e) {\n console.error(`weasel: failed to recompile program \"${id}\" after context restore:`, e);\n }\n }\n }\n\n /** Free every GL resource this renderer created and detach context-loss\n * listeners when a canvas was supplied. Idempotent.\n *\n * That covers the built-in and consumer-registered programs (their shaders\n * go with them), the shared quad geometry, the batch, the effect targets,\n * and every cache: atlas and gradient-ramp textures, bitmap and pattern\n * textures, and meshes — transient, persistent, and those whose Path was\n * already collected. The context itself is left alone, so a caller-owned\n * context can host renderer after renderer without accumulating anything.\n *\n * A disposed renderer ignores further `render()` and `registerProgram()`\n * calls. */\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n const gl = this.gl;\n if (this.canvas) {\n this.canvas.removeEventListener('webglcontextlost', this.boundOnLost);\n this.canvas.removeEventListener('webglcontextrestored', this.boundOnRestored);\n }\n this.meshCache.dispose();\n this.paintResources.release();\n for (const prog of [\n this.pathFill, this.pathFillVColor, this.imageFill, this.batchFill, this.gradFill, this.patternFill,\n ...this.glyphPaintPrograms.values(),\n ]) {\n gl.deleteProgram(prog.handle);\n }\n this.glyphPaintPrograms.clear();\n for (const prog of this.programRegistry.values()) {\n gl.deleteProgram(prog.handle);\n }\n this.programRegistry.clear();\n this.programSources.clear();\n this.textureCache.free();\n this.imageCache.dispose();\n this.gradRamps.free();\n if (this.quadVbo) gl.deleteBuffer(this.quadVbo);\n if (this.quadIbo) gl.deleteBuffer(this.quadIbo);\n this.drawBatch.dispose();\n if (this.whiteTexture) gl.deleteTexture(this.whiteTexture);\n this.whiteTexture = null;\n this.effectTargets.releaseAll();\n this.paintScratch.release();\n }\n\n /**\n * Draw one frame.\n *\n * `viewMatrix` is the frame's world→screen transform. It is only consulted\n * by `units: 'world'` gradients, which fall back to screen space without\n * it — every other command carries its own transform in the stream, so\n * callers with no view concept can keep calling `render(commands)`.\n */\n render(commands: DrawCommand[], viewMatrix?: GlMat3, opts?: RenderOptions): void {\n if (this.contextLost || this.disposed) return;\n const t0 = now();\n const counters = { drawCalls: 0 };\n const spanStats: RenderSpanStats[] = [];\n this.stats = { drawCalls: 0, ms: 0, spans: spanStats };\n const gl = this.gl;\n // Free GL resources whose Mesh was GC'd since the last frame. Done here\n // (top of render, before any draws) because GL state is known clean —\n // no VAO bound, no draw in flight. Deleting from the FinalizationRegistry\n // callback directly was racy and caused mid-draw crashes.\n this.meshCache.drainPendingDeletes();\n this.refreshPrograms();\n // New frame: refill the dynamic-glyph synchronous bake budget.\n resetBakeBudget(this.bakeBudget);\n this.groupState.reset();\n this.applyGlState();\n this.applyTarget();\n // Ensure all stencil bits are cleared regardless of any mask left over\n // from the previous frame's clip ops.\n if (this.target?.clear !== false) {\n gl.stencilMask(0xFF);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\n }\n const ctx: DrawContext = {\n gl,\n pathFill: this.pathFill,\n pathFillVColor: this.pathFillVColor,\n imageFill: this.imageFill,\n batchFill: this.batchFill,\n gradFill: this.gradFill,\n patternFill: this.patternFill,\n meshCache: this.meshCache,\n textureCache: this.textureCache,\n imageCache: this.imageCache,\n gradRamps: this.gradRamps,\n programRegistry: this.programRegistry,\n ensureProgram: (id) => this.ensureProgram(id),\n glyphPaintProgram: (kind) => this.glyphPaintProgram(kind),\n quadVbo: this.quadVbo,\n quadIbo: this.quadIbo,\n drawBatch: this.drawBatch,\n whiteTexture: this.whiteTexture,\n state: this.groupState,\n widthCss: this.widthCss,\n heightCss: this.heightCss,\n clipDepth: 0,\n flattenTolerance: this.flattenTolerance,\n textOutlineMinScreenSize: this.textOutlineMinScreenSize,\n viewMatrix,\n effectTargets: this.effectTargets,\n paintScratch: this.paintScratch,\n renderTarget: null,\n deviceWidth: Math.round(this.widthCss * this.dpr),\n deviceHeight: Math.round(this.heightCss * this.dpr),\n restoreTargetRect: () => this.applyTarget(),\n paintResources: this.paintResources,\n stats: counters,\n };\n const spans = opts?.spans ?? [];\n let next = 0;\n for (let si = 0; si < spans.length; si++) {\n const span = spans[si];\n for (; next < span.start; next++) dispatch(ctx, commands[next]);\n const drawsBefore = counters.drawCalls;\n const spanT0 = now();\n for (; next < span.end; next++) dispatch(ctx, commands[next]);\n // The stream's closing flush belongs to whatever it closes.\n if (si === spans.length - 1 && next >= commands.length) flushBatch(ctx);\n spanStats.push({ id: span.id, drawCalls: counters.drawCalls - drawsBefore, ms: now() - spanT0 });\n }\n for (; next < commands.length; next++) dispatch(ctx, commands[next]);\n // The stream ended, so whatever is still staged has nothing left that\n // could merge with it.\n flushBatch(ctx);\n // Free transient resources allocated during this frame (e.g. per-frame\n // stroke ribbons from tessellateStroke). Done after all draws complete\n // so we never delete a buffer that's still bound to a pending draw.\n this.meshCache.freeTransient();\n this.stats.drawCalls = counters.drawCalls;\n this.stats.ms = now() - t0;\n }\n\n /** What the last `render()` cost: GL draw calls issued and CPU milliseconds\n * spent issuing them, in total and per requested span. GPU time is not\n * measured; the GPU runs asynchronously. */\n lastFrameStats(): RenderStats {\n return this.stats;\n }\n\n /** Change the curve-flattening tolerance after construction. `undefined`\n * restores the cached `DEFAULT_FLATTEN_TOLERANCE` route. */\n setFlattenTolerance(tolerance: number | undefined): void {\n this.flattenTolerance = tolerance;\n }\n\n resize(dims: { width: number; height: number; dpr: number }): void {\n this.widthCss = dims.width;\n this.heightCss = dims.height;\n this.dpr = dims.dpr;\n if (this.canvas) {\n this.canvas.width = Math.round(dims.width * dims.dpr);\n this.canvas.height = Math.round(dims.height * dims.dpr);\n if (this.canvas.style) {\n this.canvas.style.width = `${dims.width}px`;\n this.canvas.style.height = `${dims.height}px`;\n }\n }\n this.applyTarget();\n }\n\n /** @internal */ _gl(): WebGL2RenderingContext { return this.gl; }\n /** @internal */ _pathFill(): ShaderProgram { return this.pathFill; }\n /** @internal */ _pathFillVColor(): ShaderProgram { return this.pathFillVColor; }\n /** @internal */ _drawBatch(): DrawBatch { return this.drawBatch; }\n /** @internal */ _imageFill(): ShaderProgram { return this.imageFill; }\n /** @internal */ _batchFill(): ShaderProgram { return this.batchFill; }\n /** @internal */ _gradFill(): ShaderProgram { return this.gradFill; }\n /** @internal */ _patternFill(): ShaderProgram { return this.patternFill; }\n /** @internal */ _meshCache(): GLMeshCache { return this.meshCache; }\n /** @internal */ _textureCache(): GLTextureCache { return this.textureCache; }\n /** @internal */ _imageCache(): GLImageCache { return this.imageCache; }\n /** @internal */ _gradRamps(): GradientRampAtlas { return this.gradRamps; }\n /** @internal */ _groupState(): GroupState { return this.groupState; }\n /** @internal */ _widthCss(): number { return this.widthCss; }\n /** @internal */ _heightCss(): number { return this.heightCss; }\n /** @internal */ _dpr(): number { return this.dpr; }\n}\n\n/** The 1x1 opaque white texture a batch flush binds when its run samples no\n * image. NEAREST both ways: one texel, so there is nothing to filter, and a\n * mipmap filter on a texture with no mipmaps is incomplete. */\nfunction createWhiteTexture(gl: WebGL2RenderingContext): WebGLTexture | null {\n const tex = gl.createTexture();\n if (!tex) return null;\n gl.bindTexture(gl.TEXTURE_2D, tex);\n gl.texImage2D(\n gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\n new Uint8Array([255, 255, 255, 255]),\n );\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.bindTexture(gl.TEXTURE_2D, null);\n return tex;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyEA,SAASA,GAAmB,GAAiB,GAA2B;CACtE,OAAO;EAAC,GAAGC;EAAqB,GAAGC,EAAoBC,CAAO;EAAG,GAAGD,EAAoBE,CAAO;CAAC;AAClG;AAIA,SAASC,EAAqB,GAA4B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