@flighthq/render 0.5.1-edge.1410.b534771 → 0.5.1-edge.1467.7e2fc7d
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/README.md +2 -2
- package/dist/contract.d.ts +1 -1
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/explainScene2DCoverage.js +5 -5
- package/dist/explainScene2DCoverage.js.map +1 -1
- package/dist/imageSurface.d.ts +4 -0
- package/dist/imageSurface.d.ts.map +1 -0
- package/dist/{raster2DSurface.js → imageSurface.js} +5 -5
- package/dist/imageSurface.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/renderProxy.js +2 -2
- package/dist/renderProxy.js.map +1 -1
- package/dist/renderRegistryGuards.d.ts +4 -4
- package/dist/renderRegistryGuards.d.ts.map +1 -1
- package/dist/renderRegistryGuards.js +18 -18
- package/dist/renderRegistryGuards.js.map +1 -1
- package/dist/renderRegistrySignals.d.ts.map +1 -1
- package/dist/renderRegistrySignals.js.map +1 -1
- package/dist/renderState.d.ts.map +1 -1
- package/dist/renderState.js +6 -3
- package/dist/renderState.js.map +1 -1
- package/package.json +13 -13
- package/src/explainScene2DCoverage.test.ts +9 -9
- package/src/imageSurface.test.ts +74 -0
- package/src/renderRegistryGuards.test.ts +25 -25
- package/src/renderState.test.ts +4 -3
- package/src/renderer.test.ts +7 -4
- package/dist/raster2DSurface.d.ts +0 -4
- package/dist/raster2DSurface.d.ts.map +0 -1
- package/dist/raster2DSurface.js.map +0 -1
- package/src/raster2DSurface.test.ts +0 -74
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/render`. The `@fligh
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/render@0.5.1-edge.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/render@0.5.1-edge.1467.7e2fc7d](https://github.com/flighthq/flight/tree/7e2fc7df5378313ceaf21ba8d6ef39cc18a6f4ad/packages/render)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/7e2fc7df5378313ceaf21ba8d6ef39cc18a6f4ad/LICENSE.md)
|
package/dist/contract.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from './renderMaterial';
|
|
|
9
9
|
export * from './renderProxy';
|
|
10
10
|
export * from './renderProxyAdapter';
|
|
11
11
|
export * from './renderQueue';
|
|
12
|
-
export * from './
|
|
12
|
+
export * from './imageSurface';
|
|
13
13
|
export * from './explainScene2DCoverage';
|
|
14
14
|
export * from './explainScene2DPipelineCoverage';
|
|
15
15
|
export * from './explainScene3DPipelineCoverage';
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/contract.js
CHANGED
|
@@ -9,7 +9,7 @@ export * from './renderMaterial';
|
|
|
9
9
|
export * from './renderProxy';
|
|
10
10
|
export * from './renderProxyAdapter';
|
|
11
11
|
export * from './renderQueue';
|
|
12
|
-
export * from './
|
|
12
|
+
export * from './imageSurface';
|
|
13
13
|
export * from './explainScene2DCoverage';
|
|
14
14
|
export * from './explainScene2DPipelineCoverage';
|
|
15
15
|
export * from './explainScene3DPipelineCoverage';
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegistryEntryState,
|
|
1
|
+
import { RegistryEntryState, RenderRegistryTable, RequirementFacet, SceneCoverage } from '@flighthq/types/contract';
|
|
2
2
|
import { getRenderStateRuntime } from './renderState';
|
|
3
3
|
// Clears `out`, then reports every requirement in `usage` that any 2D backend answers the same way,
|
|
4
4
|
// with how well this state is wired for it — satisfied entries included, so one call is a manifest.
|
|
@@ -35,14 +35,14 @@ function collectScene2DCoverageGaps(out, state, usage, stopAtFirst, catalog) {
|
|
|
35
35
|
coverage: SceneCoverage.Satisfied,
|
|
36
36
|
facet: RequirementFacet.SceneNodeKind,
|
|
37
37
|
kind,
|
|
38
|
-
registry:
|
|
38
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
39
39
|
});
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
42
|
found = true;
|
|
43
43
|
if (stopAtFirst)
|
|
44
44
|
return true;
|
|
45
|
-
out?.push(createShortfallEntry(catalog, false, RequirementFacet.SceneNodeKind, kind,
|
|
45
|
+
out?.push(createShortfallEntry(catalog, false, RequirementFacet.SceneNodeKind, kind, RenderRegistryTable.NodeRenderer));
|
|
46
46
|
}
|
|
47
47
|
// Only meaningful for a state that rasterizes shapes. A GL or WebGPU state drawing every shape
|
|
48
48
|
// through the mesh path never replays a command, so these entries are reported and simply not acted
|
|
@@ -55,14 +55,14 @@ function collectScene2DCoverageGaps(out, state, usage, stopAtFirst, catalog) {
|
|
|
55
55
|
coverage: SceneCoverage.Satisfied,
|
|
56
56
|
facet: RequirementFacet.SceneShapeCommand,
|
|
57
57
|
kind,
|
|
58
|
-
registry:
|
|
58
|
+
registry: RenderRegistryTable.ShapeCommandHandler,
|
|
59
59
|
});
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
62
|
found = true;
|
|
63
63
|
if (stopAtFirst)
|
|
64
64
|
return true;
|
|
65
|
-
out?.push(createShortfallEntry(catalog, false, RequirementFacet.SceneShapeCommand, kind,
|
|
65
|
+
out?.push(createShortfallEntry(catalog, false, RequirementFacet.SceneShapeCommand, kind, RenderRegistryTable.ShapeCommandHandler));
|
|
66
66
|
}
|
|
67
67
|
return found;
|
|
68
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explainScene2DCoverage.js","sourceRoot":"","sources":["../src/explainScene2DCoverage.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"explainScene2DCoverage.js","sourceRoot":"","sources":["../src/explainScene2DCoverage.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,oGAAoG;AACpG,oGAAoG;AACpG,EAAE;AACF,uGAAuG;AACvG,yGAAyG;AACzG,sGAAsG;AACtG,iGAAiG;AACjG,EAAE;AACF,qGAAqG;AACrG,iGAAiG;AACjG,uGAAuG;AACvG,6FAA6F;AAC7F,MAAM,UAAU,sBAAsB,CACpC,GAAyB,EACzB,KAAkB,EAClB,KAAiC,EACjC,OAA6B;IAE7B,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IACf,0BAA0B,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED,mGAAmG;AACnG,mGAAmG;AACnG,MAAM,UAAU,kBAAkB,CAAC,KAAkB,EAAE,KAAiC;IACtF,OAAO,CAAC,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,qGAAqG;AACrG,0GAA0G;AAC1G,SAAS,0BAA0B,CACjC,GAAgC,EAChC,KAAkB,EAClB,KAAiC,EACjC,WAAoB,EACpB,OAAoC;IAEpC,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,MAAM,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE7C,+FAA+F;IAC/F,iGAAiG;I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IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAChG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ImageSurface, ImageSurfaceCreator } from '@flighthq/types/contract';
|
|
2
|
+
export declare function createImageSurface(provider: Readonly<ImageSurfaceCreator>, width: number, height: number): ImageSurface | null;
|
|
3
|
+
export declare function destroyImageSurface(surface: ImageSurface): void;
|
|
4
|
+
//# sourceMappingURL=imageSurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageSurface.d.ts","sourceRoot":"","sources":["../src/imageSurface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAElF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,YAAY,GAAG,IAAI,CAIrB;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAK/D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export function
|
|
2
|
-
const surface = provider.
|
|
1
|
+
export function createImageSurface(provider, width, height) {
|
|
2
|
+
const surface = provider.createImageSurface(width, height);
|
|
3
3
|
if (surface !== null)
|
|
4
4
|
_surfaceProviders.set(surface, provider);
|
|
5
5
|
return surface;
|
|
@@ -7,12 +7,12 @@ export function createRaster2DSurface(provider, width, height) {
|
|
|
7
7
|
// A surface must return to the provider that allocated it even when the provider reference changes
|
|
8
8
|
// during its lifetime. Delete the ownership record before invoking the provider so repeated or
|
|
9
9
|
// reentrant destruction is a no-op and no non-GC resource can be freed twice.
|
|
10
|
-
export function
|
|
10
|
+
export function destroyImageSurface(surface) {
|
|
11
11
|
const provider = _surfaceProviders.get(surface);
|
|
12
12
|
if (provider === undefined)
|
|
13
13
|
return;
|
|
14
14
|
_surfaceProviders.delete(surface);
|
|
15
|
-
provider.
|
|
15
|
+
provider.destroyImageSurface(surface);
|
|
16
16
|
}
|
|
17
17
|
const _surfaceProviders = new WeakMap();
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=imageSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageSurface.js","sourceRoot":"","sources":["../src/imageSurface.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAChC,QAAuC,EACvC,KAAa,EACb,MAAc;IAEd,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3D,IAAI,OAAO,KAAK,IAAI;QAAE,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/D,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,mGAAmG;AACnG,+FAA+F;AAC/F,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB,CAAC,OAAqB;IACvD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO;IACnC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAA+C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { areColorAdjustmentsEnabled,
|
|
1
|
+
export { areColorAdjustmentsEnabled, createImageSurface, destroyImageSurface, disableSceneRenderGuards, enableColorAdjustments, enableSceneRenderGuards, createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistriesGuards, enableRenderRegistrySignals, explainRenderRegistriesMisses, explainScene2DPipelineCoverage, explainScene3DPipelineCoverage, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
|
|
2
2
|
export { SCENE2D_WORKING_COLOR_SPACE } from './scene2dWorkingColorSpace';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { areColorAdjustmentsEnabled,
|
|
1
|
+
export { areColorAdjustmentsEnabled, createImageSurface, destroyImageSurface, disableSceneRenderGuards, enableColorAdjustments, enableSceneRenderGuards, createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistriesGuards, enableRenderRegistrySignals, explainRenderRegistriesMisses, explainScene2DPipelineCoverage, explainScene3DPipelineCoverage, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
|
|
2
2
|
export { SCENE2D_WORKING_COLOR_SPACE } from './scene2dWorkingColorSpace';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/renderProxy.js
CHANGED
|
@@ -2,7 +2,7 @@ import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
|
2
2
|
import { createMatrix } from '@flighthq/geometry/contract';
|
|
3
3
|
import { getNodeAppearanceRevision, getNodeChildrenRevision, getNodeLocalContentRevision, getNodeLocalTransformRevision, getNodeParentReferenceRevision, getNodeParent, getNodeRuntime, } from '@flighthq/node/contract';
|
|
4
4
|
import { getRegistryTableEntry } from '@flighthq/registry/contract';
|
|
5
|
-
import { BlendMode, RegistryEntryState,
|
|
5
|
+
import { BlendMode, RegistryEntryState, RenderRegistryTable } from '@flighthq/types/contract';
|
|
6
6
|
import { updateRenderProxyAppearance } from './renderAppearance';
|
|
7
7
|
import { updateRenderProxyMaterial } from './renderMaterial';
|
|
8
8
|
import { getRenderStateRuntime } from './renderState';
|
|
@@ -167,7 +167,7 @@ function resolveRenderProxyRenderer(state, kind) {
|
|
|
167
167
|
const runtime = getRenderStateRuntime(state);
|
|
168
168
|
const entry = runtime.registries.renderers.entries.get(kind);
|
|
169
169
|
if (entry?.state !== RegistryEntryState.Bound) {
|
|
170
|
-
runtime.registryMiss?.(
|
|
170
|
+
runtime.registryMiss?.(RenderRegistryTable.NodeRenderer, kind);
|
|
171
171
|
return null;
|
|
172
172
|
}
|
|
173
173
|
return entry.value;
|
package/dist/renderProxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderProxy.js","sourceRoot":"","sources":["../src/renderProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,aAAa,EACb,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAapE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"renderProxy.js","sourceRoot":"","sources":["../src/renderProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,aAAa,EACb,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAapE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE9F,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MA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,qBAAqB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;IACzD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEpB,OAAO,WAAW,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,WAAW,CAAe,CAAC;QACvD,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACtB,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAe,CAAC,CAAC,QAAQ,CAAC;QAC1D,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC9C,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAA0B,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
1
|
+
import type { RenderRegistriesMissExplanation, RenderState } from '@flighthq/types/contract';
|
|
2
|
+
export declare function areRenderRegistriesGuardsEnabled(state: RenderState): boolean;
|
|
3
|
+
export declare function enableRenderRegistriesGuards(state: RenderState): void;
|
|
4
|
+
export declare function explainRenderRegistriesMisses(state: RenderState): RenderRegistriesMissExplanation;
|
|
5
5
|
//# sourceMappingURL=renderRegistryGuards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRegistryGuards.d.ts","sourceRoot":"","sources":["../src/renderRegistryGuards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"renderRegistryGuards.d.ts","sourceRoot":"","sources":["../src/renderRegistryGuards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,+BAA+B,EAC/B,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAKlC,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE5E;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAQrE;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,WAAW,GAAG,+BAA+B,CAMjG"}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import { logOnce } from '@flighthq/log/contract';
|
|
2
2
|
import { connectSignal } from '@flighthq/signals/contract';
|
|
3
|
-
import { LogLevel,
|
|
3
|
+
import { LogLevel, RenderRegistryTable } from '@flighthq/types/contract';
|
|
4
4
|
import { enableRenderRegistrySignals } from './renderRegistrySignals';
|
|
5
|
-
export function
|
|
5
|
+
export function areRenderRegistriesGuardsEnabled(state) {
|
|
6
6
|
return _stateIds.has(state);
|
|
7
7
|
}
|
|
8
|
-
export function
|
|
8
|
+
export function enableRenderRegistriesGuards(state) {
|
|
9
9
|
if (_stateIds.has(state))
|
|
10
10
|
return;
|
|
11
11
|
const stateId = ++_nextStateId;
|
|
12
12
|
_stateIds.set(state, stateId);
|
|
13
13
|
_stateMisses.set(state, []);
|
|
14
14
|
connectSignal(enableRenderRegistrySignals(state).onRegistryMiss, (registry, kind) => {
|
|
15
|
-
|
|
15
|
+
recordRenderRegistriesMiss(state, stateId, registry, kind);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
export function
|
|
18
|
+
export function explainRenderRegistriesMisses(state) {
|
|
19
19
|
const misses = _stateMisses.get(state) ?? [];
|
|
20
20
|
return {
|
|
21
21
|
misses: misses.map((miss) => ({ kind: miss.kind, registry: miss.registry })),
|
|
22
22
|
status: misses.length === 0 ? 'complete' : 'misses-recorded',
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function getRenderRegistriesMissMessage(state, registry) {
|
|
26
26
|
switch (registry) {
|
|
27
27
|
// GL composites through an explicit per-mode realization; Canvas and DOM express blend modes
|
|
28
28
|
// natively and never report this.
|
|
29
|
-
case
|
|
29
|
+
case RenderRegistryTable.BlendRealization:
|
|
30
30
|
return 'a blend mode this scene uses has no registered GL realization, so the node composites as Normal instead — call registerGlBlendMode(state, blendMode, realization)';
|
|
31
|
-
case
|
|
31
|
+
case RenderRegistryTable.EffectPaddingResolver:
|
|
32
32
|
return 'computeRenderEffectPadding: effect kind has no registered padding resolver — call registerRenderEffectPaddingResolver(state, kind, resolver)';
|
|
33
33
|
// Reported by the resource layer, not the frame path: a material kind with no lister has its
|
|
34
34
|
// texture slots invisible to anything that walks materials. Discovery no longer depends on this
|
|
35
35
|
// (it reads the resource back-edge). On an all-unlisted mesh, reveal-on-resolve leaves the starting
|
|
36
36
|
// alpha unchanged. On a mixed mesh, it can reveal after the listed textures settle while an unlisted
|
|
37
37
|
// texture is still pending.
|
|
38
|
-
case
|
|
38
|
+
case RenderRegistryTable.MaterialTextureLister:
|
|
39
39
|
return "a material kind in this scene has no registered texture lister, so an all-unlisted mesh gets no fade, while a mixed mesh can reveal before that material's textures settle and show a later texture pop-in — call registerScene3DMaterialTextures(registry, kind, lister), or the named door for that family";
|
|
40
40
|
// Reported only by the GPU backends, where an unresolved material means the node does not draw at
|
|
41
41
|
// all. The Canvas renderer treats a missing material renderer as "draw normally", so the same
|
|
42
42
|
// absence there is the ordinary case rather than a defect.
|
|
43
|
-
case
|
|
43
|
+
case RenderRegistryTable.MaterialRenderer:
|
|
44
44
|
if ('device' in state)
|
|
45
45
|
return 'resolveWgpuMaterialRenderer: material kind has no registered renderer, so nodes using it do not draw — call registerWgpuMaterialRenderer(state, kind, renderer)';
|
|
46
46
|
return 'resolveGlMaterialRenderer: material kind has no registered renderer, so nodes using it do not draw — call registerGlMaterialRenderer(state, kind, renderer)';
|
|
47
47
|
// Reported by the proactive coverage checks (explainGlScene3DCoverage) rather than by a draw-time
|
|
48
48
|
// miss: the shaded compiler resolves a whole stack at once, so a missing snippet surfaces as a
|
|
49
49
|
// material that will not compile, not as one lookup returning null.
|
|
50
|
-
case
|
|
50
|
+
case RenderRegistryTable.ModifierSnippet:
|
|
51
51
|
if ('device' in state)
|
|
52
52
|
return 'a modifier on this material has no registered shader snippet — call registerWgpuModifierSnippet(state, snippet), or registerBuiltInWgpuModifierSnippets(state)';
|
|
53
53
|
return 'a modifier on this material has no registered shader snippet — call registerGlModifierSnippet(state, snippet), or registerBuiltInGlModifierSnippets(state)';
|
|
54
|
-
case
|
|
54
|
+
case RenderRegistryTable.NodeRenderer:
|
|
55
55
|
return 'createRenderProxy: node kind has no registered renderer — call registerRenderer(state, kind, renderer)';
|
|
56
|
-
case
|
|
56
|
+
case RenderRegistryTable.ShapeCommandHandler:
|
|
57
57
|
return 'renderCanvasShapeCommands: shape command key has no registered handler on this state — call registerCanvasShapeCommand(state, command)';
|
|
58
58
|
// The kind reported is the node kind that went undrawn, since nothing here is keyed by anything else.
|
|
59
|
-
case
|
|
59
|
+
case RenderRegistryTable.ShapeRasterizer:
|
|
60
60
|
if ('device' in state)
|
|
61
61
|
return 'drawWgpuShape: a fill this node uses has no tessellated form and no rasterizer is registered, so it does not draw — call registerWgpuShapeRasterizer(state, createCanvasShapeRasterizer(resolvers))';
|
|
62
62
|
if ('element' in state)
|
|
63
63
|
return 'drawDomShape: a fill this node uses has no tessellated form and no rasterizer is registered, so it does not draw — call registerDomShapeRasterizer(state, createCanvasShapeRasterizer(resolvers))';
|
|
64
64
|
return 'drawGlShape: a fill this node uses has no tessellated form and no rasterizer is registered, so it does not draw — call registerGlShapeRasterizer(state, createCanvasShapeRasterizer(resolvers))';
|
|
65
|
-
case
|
|
65
|
+
case RenderRegistryTable.TextureResolver:
|
|
66
66
|
if ('gl' in state)
|
|
67
|
-
return 'resolveGlTexture: texture source kind has no registered resolver — rebuild the
|
|
67
|
+
return 'resolveGlTexture: texture source kind has no registered resolver — rebuild the GlRenderRegistries with the required resolver and create the render state from that registry';
|
|
68
68
|
if ('device' in state)
|
|
69
69
|
return 'resolveWgpuTexture: texture source kind has no registered resolver — call registerWgpuTextureResolver(state, sourceKind, resolver)';
|
|
70
70
|
if ('element' in state)
|
|
@@ -72,14 +72,14 @@ function getRenderRegistryMissMessage(state, registry) {
|
|
|
72
72
|
return 'resolveCanvasTexture: texture source kind has no registered resolver — call registerCanvasTextureResolver(resolvers, sourceKind, resolver) on the set the caller resolves through';
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function recordRenderRegistriesMiss(state, stateId, registry, kind) {
|
|
76
76
|
const misses = _stateMisses.get(state);
|
|
77
77
|
if (misses === undefined || misses.some((miss) => miss.registry === registry && miss.kind === kind))
|
|
78
78
|
return;
|
|
79
79
|
misses.push({ kind, registry });
|
|
80
80
|
logOnce(`render:registry-miss:${stateId}:${registry}:${kind}`, LogLevel.Warn, {
|
|
81
81
|
kind,
|
|
82
|
-
message:
|
|
82
|
+
message: getRenderRegistriesMissMessage(state, registry),
|
|
83
83
|
registry,
|
|
84
84
|
}, 'render');
|
|
85
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRegistryGuards.js","sourceRoot":"","sources":["../src/renderRegistryGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"renderRegistryGuards.js","sourceRoot":"","sources":["../src/renderRegistryGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO3D,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,UAAU,gCAAgC,CAAC,KAAkB;IACjE,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AAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO;IAC5G,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAChC,OAAO,CACL,wBAAwB,OAAO,IAAI,QAAQ,IAAI,IAAI,EAAE,EACrD,QAAQ,CAAC,IAAI,EACb;QACE,IAAI;QACJ,OAAO,EAAE,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC;QACxD,QAAQ;KACT,EACD,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,OAAO,EAAuB,CAAC;AACrD,MAAM,YAAY,GAAG,IAAI,OAAO,EAAuC,CAAC;AACxE,IAAI,YAAY,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRegistrySignals.d.ts","sourceRoot":"","sources":["../src/renderRegistrySignals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAsB,MAAM,0BAA0B,CAAC;AASvG,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,WAAW,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"renderRegistrySignals.d.ts","sourceRoot":"","sources":["../src/renderRegistrySignals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAsB,MAAM,0BAA0B,CAAC;AASvG,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,WAAW,GAAG,qBAAqB,CAYrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRegistrySignals.js","sourceRoot":"","sources":["../src/renderRegistrySignals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;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AO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderState.d.ts","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,+BAA+B,EAC/B,WAAW,EACX,kBAAkB,EAElB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAIzE;AAOD,wBAAgB,wBAAwB,IAAI,kBAAkB,
|
|
1
|
+
{"version":3,"file":"renderState.d.ts","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,+BAA+B,EAC/B,WAAW,EACX,kBAAkB,EAElB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAIzE;AAOD,wBAAgB,wBAAwB,IAAI,kBAAkB,CAkB7D;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAO3D;AAED,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,WAAW,GAAG,+BAA+B,GAAG,IAAI,CAG7G;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB,CAE5E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAY9G"}
|
package/dist/renderState.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { allocateEntity, createEntityRuntime, finishEntity } from '@flighthq/entity/contract';
|
|
2
|
-
import { createKeyedTable
|
|
2
|
+
import { createKeyedTable } from '@flighthq/registry/contract';
|
|
3
3
|
import { BlendMode, EntityRuntimeKey, RegistryEntryState } from '@flighthq/types/contract';
|
|
4
4
|
export function createRenderState(obj) {
|
|
5
5
|
const state = allocateEntity();
|
|
@@ -21,7 +21,10 @@ export function createRenderStateRuntime() {
|
|
|
21
21
|
runtime.registryMiss = null;
|
|
22
22
|
runtime.registries = {
|
|
23
23
|
renderers: createKeyedTable('NodeRenderer', 'Unregistered'),
|
|
24
|
-
|
|
24
|
+
// Written as null rather than left off: the field's presence is what keeps every registries object
|
|
25
|
+
// one hidden class, so the per-shape reads on the draw path stay monomorphic. The opt-in registrar
|
|
26
|
+
// fills the slot; nothing allocates a table for a state that never opts in.
|
|
27
|
+
strokeTessellator: null,
|
|
25
28
|
};
|
|
26
29
|
runtime.rendererMapId = 0;
|
|
27
30
|
runtime.tempStack = [];
|
|
@@ -52,7 +55,7 @@ export function initializeRenderState(state, obj) {
|
|
|
52
55
|
state.currentClipDepth = obj?.currentClipDepth ?? 0;
|
|
53
56
|
state.displayObjectClipHooks = obj?.displayObjectClipHooks ?? null;
|
|
54
57
|
state.pixelRatio = obj?.pixelRatio ?? 1;
|
|
55
|
-
state.
|
|
58
|
+
state.imageSurfaceProvider = obj?.imageSurfaceProvider ?? null;
|
|
56
59
|
state.renderAlpha = obj?.renderAlpha ?? 1;
|
|
57
60
|
state.renderBlendMode = obj?.renderBlendMode ?? BlendMode.Normal;
|
|
58
61
|
state.renderTransform2D = obj?.renderTransform2D ?? null;
|
package/dist/renderState.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderState.js","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"renderState.js","sourceRoot":"","sources":["../src/renderState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,2BAA2B,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CAAC;IACjE,KAAK,CAAC,iBAAiB,GAAG,GAAG,EAAE,iBAAiB,IAAI,IAAI,CAAC;IACzD,KAAK,CAAC,WAAW,GAAG,GAAG,EAAE,WAAW,IAAI,KAAK,CAAC;IAC9C,KAAK,CAAC,oBAAoB,GAAG,GAAG,EAAE,oBAAoB,IAAI,qBAAqB,CAAC;IAChF,KAAK,CAAC,gBAAgB,CAAC,GAAG,wBAAwB,EAAE,CAAC;AACvD,CAAC;AAED,SAAS,6BAA6B,CAAC,KAAkB,EAAE,MAAkB;IAC3E,MAAM,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,KAAK,EAAE,YAAY,KAAK,IAAI,IAAI,KAAK,EAAE,YAAY,KAAK,SAAS,EAAE,CAAC;QACtE,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/render",
|
|
3
|
-
"version": "0.5.1-edge.
|
|
3
|
+
"version": "0.5.1-edge.1467.7e2fc7d",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/adjustments": "0.5.1-edge.
|
|
42
|
-
"@flighthq/camera": "0.5.1-edge.
|
|
43
|
-
"@flighthq/color": "0.5.1-edge.
|
|
44
|
-
"@flighthq/entity": "0.5.1-edge.
|
|
45
|
-
"@flighthq/geometry": "0.5.1-edge.
|
|
46
|
-
"@flighthq/log": "0.5.1-edge.
|
|
47
|
-
"@flighthq/materials": "0.5.1-edge.
|
|
48
|
-
"@flighthq/mesh": "0.5.1-edge.
|
|
49
|
-
"@flighthq/node": "0.5.1-edge.
|
|
50
|
-
"@flighthq/registry": "0.5.1-edge.
|
|
51
|
-
"@flighthq/signals": "0.5.1-edge.
|
|
52
|
-
"@flighthq/types": "0.5.1-edge.
|
|
41
|
+
"@flighthq/adjustments": "0.5.1-edge.1467.7e2fc7d",
|
|
42
|
+
"@flighthq/camera": "0.5.1-edge.1467.7e2fc7d",
|
|
43
|
+
"@flighthq/color": "0.5.1-edge.1467.7e2fc7d",
|
|
44
|
+
"@flighthq/entity": "0.5.1-edge.1467.7e2fc7d",
|
|
45
|
+
"@flighthq/geometry": "0.5.1-edge.1467.7e2fc7d",
|
|
46
|
+
"@flighthq/log": "0.5.1-edge.1467.7e2fc7d",
|
|
47
|
+
"@flighthq/materials": "0.5.1-edge.1467.7e2fc7d",
|
|
48
|
+
"@flighthq/mesh": "0.5.1-edge.1467.7e2fc7d",
|
|
49
|
+
"@flighthq/node": "0.5.1-edge.1467.7e2fc7d",
|
|
50
|
+
"@flighthq/registry": "0.5.1-edge.1467.7e2fc7d",
|
|
51
|
+
"@flighthq/signals": "0.5.1-edge.1467.7e2fc7d",
|
|
52
|
+
"@flighthq/types": "0.5.1-edge.1467.7e2fc7d"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@flighthq/scene2d": "*",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Renderer, Scene2DKindUsage, SceneCoverageCatalog, SceneCoverageEntry } from '@flighthq/types/contract';
|
|
2
|
-
import { RegistryEntryState,
|
|
2
|
+
import { RegistryEntryState, RenderRegistryTable, RequirementFacet, SceneCoverage } from '@flighthq/types/contract';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
5
|
import { explainScene2DCoverage, hasScene2DCoverage } from './explainScene2DCoverage';
|
|
@@ -15,17 +15,17 @@ const coverageCatalog: SceneCoverageCatalog = [
|
|
|
15
15
|
{ module: '@flighthq/scene2d', registrar: 'registerShapeRenderer' },
|
|
16
16
|
{ module: '@flighthq/scene2d-canvas', registrar: 'registerCanvasShapeCommands' },
|
|
17
17
|
],
|
|
18
|
-
registry:
|
|
18
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
kind: 'Sprite',
|
|
22
22
|
registrations: [{ module: '@flighthq/scene2d', registrar: 'registerSpriteRenderer' }],
|
|
23
|
-
registry:
|
|
23
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
kind: 'beginFill',
|
|
27
27
|
registrations: [{ module: '@flighthq/scene2d-canvas', registrar: 'registerCanvasShapeCommands' }],
|
|
28
|
-
registry:
|
|
28
|
+
registry: RenderRegistryTable.ShapeCommandHandler,
|
|
29
29
|
},
|
|
30
30
|
];
|
|
31
31
|
|
|
@@ -64,7 +64,7 @@ describe('explainScene2DCoverage', () => {
|
|
|
64
64
|
kind: 'Shape',
|
|
65
65
|
module: '@flighthq/scene2d',
|
|
66
66
|
registrar: 'registerShapeRenderer',
|
|
67
|
-
registry:
|
|
67
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
68
68
|
},
|
|
69
69
|
]);
|
|
70
70
|
});
|
|
@@ -75,7 +75,7 @@ describe('explainScene2DCoverage', () => {
|
|
|
75
75
|
coverage: SceneCoverage.Unavailable,
|
|
76
76
|
facet: RequirementFacet.SceneNodeKind,
|
|
77
77
|
kind: 'Shape',
|
|
78
|
-
registry:
|
|
78
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
79
79
|
},
|
|
80
80
|
]);
|
|
81
81
|
});
|
|
@@ -88,7 +88,7 @@ describe('explainScene2DCoverage', () => {
|
|
|
88
88
|
coverage: SceneCoverage.Satisfied,
|
|
89
89
|
facet: RequirementFacet.SceneNodeKind,
|
|
90
90
|
kind: 'Shape',
|
|
91
|
-
registry:
|
|
91
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
92
92
|
},
|
|
93
93
|
]);
|
|
94
94
|
});
|
|
@@ -100,7 +100,7 @@ describe('explainScene2DCoverage', () => {
|
|
|
100
100
|
kind: 'beginFill',
|
|
101
101
|
module: '@flighthq/scene2d-canvas',
|
|
102
102
|
registrar: 'registerCanvasShapeCommands',
|
|
103
|
-
registry:
|
|
103
|
+
registry: RenderRegistryTable.ShapeCommandHandler,
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
|
|
@@ -111,7 +111,7 @@ describe('explainScene2DCoverage', () => {
|
|
|
111
111
|
coverage: SceneCoverage.Satisfied,
|
|
112
112
|
facet: RequirementFacet.SceneShapeCommand,
|
|
113
113
|
kind: 'beginFill',
|
|
114
|
-
registry:
|
|
114
|
+
registry: RenderRegistryTable.ShapeCommandHandler,
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
|
+
import type { Entity, ImageSurface, ImageSurfaceCreator } from '@flighthq/types/contract';
|
|
3
|
+
|
|
4
|
+
import { createImageSurface, destroyImageSurface } from './imageSurface';
|
|
5
|
+
|
|
6
|
+
function entityProvider(fields: Omit<ImageSurfaceCreator, keyof Entity>): ImageSurfaceCreator {
|
|
7
|
+
return (() => {
|
|
8
|
+
const out = allocateEntity<any>();
|
|
9
|
+
Object.assign(out, fields);
|
|
10
|
+
return finishEntity(out);
|
|
11
|
+
})();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('createImageSurface', () => {
|
|
15
|
+
it('passes exact dimensions through the given provider and preserves its result', () => {
|
|
16
|
+
const surface = {} as ImageSurface;
|
|
17
|
+
const create = vi.fn(() => surface);
|
|
18
|
+
const provider = entityProvider({ createImageSurface: create, destroyImageSurface() {} });
|
|
19
|
+
|
|
20
|
+
expect(createImageSurface(provider, 30, 40)).toBe(surface);
|
|
21
|
+
expect(create).toHaveBeenCalledOnce();
|
|
22
|
+
expect(create).toHaveBeenCalledWith(30, 40);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('preserves provider refusal as expected absence', () => {
|
|
26
|
+
const provider = entityProvider({ createImageSurface: () => null, destroyImageSurface() {} });
|
|
27
|
+
expect(createImageSurface(provider, 10, 20)).toBeNull();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('destroyImageSurface', () => {
|
|
32
|
+
it('routes each surface to its creator even when different providers were used', () => {
|
|
33
|
+
const firstSurface = {} as ImageSurface;
|
|
34
|
+
const secondSurface = {} as ImageSurface;
|
|
35
|
+
const firstDestroy = vi.fn();
|
|
36
|
+
const secondDestroy = vi.fn();
|
|
37
|
+
const first = entityProvider({
|
|
38
|
+
createImageSurface: () => firstSurface,
|
|
39
|
+
destroyImageSurface: firstDestroy,
|
|
40
|
+
});
|
|
41
|
+
const second = entityProvider({
|
|
42
|
+
createImageSurface: () => secondSurface,
|
|
43
|
+
destroyImageSurface: secondDestroy,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(createImageSurface(first, 10, 20)).toBe(firstSurface);
|
|
47
|
+
expect(createImageSurface(second, 30, 40)).toBe(secondSurface);
|
|
48
|
+
|
|
49
|
+
destroyImageSurface(firstSurface);
|
|
50
|
+
destroyImageSurface(secondSurface);
|
|
51
|
+
|
|
52
|
+
expect(firstDestroy).toHaveBeenCalledExactlyOnceWith(firstSurface);
|
|
53
|
+
expect(secondDestroy).toHaveBeenCalledExactlyOnceWith(secondSurface);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('is a no-op after the surface has been destroyed once', () => {
|
|
57
|
+
const surface = {} as ImageSurface;
|
|
58
|
+
const destroy = vi.fn();
|
|
59
|
+
const provider = entityProvider({
|
|
60
|
+
createImageSurface: () => surface,
|
|
61
|
+
destroyImageSurface: destroy,
|
|
62
|
+
});
|
|
63
|
+
expect(createImageSurface(provider, 10, 20)).toBe(surface);
|
|
64
|
+
|
|
65
|
+
destroyImageSurface(surface);
|
|
66
|
+
destroyImageSurface(surface);
|
|
67
|
+
|
|
68
|
+
expect(destroy).toHaveBeenCalledOnce();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('is a no-op for an unknown surface', () => {
|
|
72
|
+
expect(() => destroyImageSurface({} as ImageSurface)).not.toThrow();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { addLogSink, createMemoryLogSink, getMemoryLogSinkEntries, removeLogSink } from '@flighthq/log/contract';
|
|
2
2
|
import { emitSignal } from '@flighthq/signals/contract';
|
|
3
|
-
import {
|
|
3
|
+
import { RenderRegistryTable } from '@flighthq/types/contract';
|
|
4
4
|
|
|
5
5
|
import { registerRenderer } from './renderer';
|
|
6
6
|
import { createRenderProxy } from './renderProxy';
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
areRenderRegistriesGuardsEnabled,
|
|
9
|
+
enableRenderRegistriesGuards,
|
|
10
|
+
explainRenderRegistriesMisses,
|
|
11
11
|
} from './renderRegistryGuards';
|
|
12
12
|
import { enableRenderRegistrySignals } from './renderRegistrySignals';
|
|
13
13
|
import { createRenderState } from './renderState';
|
|
14
14
|
|
|
15
|
-
describe('
|
|
15
|
+
describe('areRenderRegistriesGuardsEnabled', () => {
|
|
16
16
|
it('reports whether the state-local registry guard is enabled', () => {
|
|
17
17
|
const state = createRenderState();
|
|
18
|
-
expect(
|
|
19
|
-
|
|
20
|
-
expect(
|
|
18
|
+
expect(areRenderRegistriesGuardsEnabled(state)).toBe(false);
|
|
19
|
+
enableRenderRegistriesGuards(state);
|
|
20
|
+
expect(areRenderRegistriesGuardsEnabled(state)).toBe(true);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
describe('
|
|
24
|
+
describe('enableRenderRegistriesGuards', () => {
|
|
25
25
|
it('is idempotent', () => {
|
|
26
26
|
const state = createRenderState();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
expect(
|
|
27
|
+
enableRenderRegistriesGuards(state);
|
|
28
|
+
enableRenderRegistriesGuards(state);
|
|
29
|
+
expect(areRenderRegistriesGuardsEnabled(state)).toBe(true);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
it('warns once per state, registry, and kind', () => {
|
|
@@ -34,8 +34,8 @@ describe('enableRenderRegistryGuards', () => {
|
|
|
34
34
|
const secondState = createRenderState();
|
|
35
35
|
const sink = createMemoryLogSink(4);
|
|
36
36
|
addLogSink(sink.sink);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
enableRenderRegistriesGuards(firstState);
|
|
38
|
+
enableRenderRegistriesGuards(secondState);
|
|
39
39
|
try {
|
|
40
40
|
createRenderProxy(firstState, { kind: 'acme.Missing' } as never);
|
|
41
41
|
createRenderProxy(firstState, { kind: 'acme.Missing' } as never);
|
|
@@ -47,7 +47,7 @@ describe('enableRenderRegistryGuards', () => {
|
|
|
47
47
|
kind: 'acme.Missing',
|
|
48
48
|
message:
|
|
49
49
|
'createRenderProxy: node kind has no registered renderer — call registerRenderer(state, kind, renderer)',
|
|
50
|
-
registry:
|
|
50
|
+
registry: RenderRegistryTable.NodeRenderer,
|
|
51
51
|
});
|
|
52
52
|
} finally {
|
|
53
53
|
removeLogSink(sink.sink);
|
|
@@ -58,7 +58,7 @@ describe('enableRenderRegistryGuards', () => {
|
|
|
58
58
|
const state = createRenderState();
|
|
59
59
|
const sink = createMemoryLogSink(1);
|
|
60
60
|
addLogSink(sink.sink);
|
|
61
|
-
|
|
61
|
+
enableRenderRegistriesGuards(state);
|
|
62
62
|
registerRenderer(state, 'acme.Registered', { createData: () => null, submit: () => {} });
|
|
63
63
|
try {
|
|
64
64
|
createRenderProxy(state, { kind: 'acme.Registered' } as never);
|
|
@@ -69,19 +69,19 @@ describe('enableRenderRegistryGuards', () => {
|
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
describe('
|
|
72
|
+
describe('explainRenderRegistriesMisses', () => {
|
|
73
73
|
it('returns each recorded registry and kind pair once in event order', () => {
|
|
74
74
|
const state = createRenderState();
|
|
75
|
-
|
|
75
|
+
enableRenderRegistriesGuards(state);
|
|
76
76
|
const signals = enableRenderRegistrySignals(state);
|
|
77
|
-
emitSignal(signals.onRegistryMiss,
|
|
78
|
-
emitSignal(signals.onRegistryMiss,
|
|
79
|
-
emitSignal(signals.onRegistryMiss,
|
|
77
|
+
emitSignal(signals.onRegistryMiss, RenderRegistryTable.TextureResolver, 'acme.Texture');
|
|
78
|
+
emitSignal(signals.onRegistryMiss, RenderRegistryTable.TextureResolver, 'acme.Texture');
|
|
79
|
+
emitSignal(signals.onRegistryMiss, RenderRegistryTable.ShapeCommandHandler, 'acme.ShapeCommand');
|
|
80
80
|
|
|
81
|
-
expect(
|
|
81
|
+
expect(explainRenderRegistriesMisses(state)).toEqual({
|
|
82
82
|
misses: [
|
|
83
|
-
{ kind: 'acme.Texture', registry:
|
|
84
|
-
{ kind: 'acme.ShapeCommand', registry:
|
|
83
|
+
{ kind: 'acme.Texture', registry: RenderRegistryTable.TextureResolver },
|
|
84
|
+
{ kind: 'acme.ShapeCommand', registry: RenderRegistryTable.ShapeCommandHandler },
|
|
85
85
|
],
|
|
86
86
|
status: 'misses-recorded',
|
|
87
87
|
});
|
|
@@ -89,6 +89,6 @@ describe('explainRenderRegistryMisses', () => {
|
|
|
89
89
|
|
|
90
90
|
it('returns a complete empty explanation before any miss is recorded', () => {
|
|
91
91
|
const state = createRenderState();
|
|
92
|
-
expect(
|
|
92
|
+
expect(explainRenderRegistriesMisses(state)).toEqual({ misses: [], status: 'complete' });
|
|
93
93
|
});
|
|
94
94
|
});
|
package/src/renderState.test.ts
CHANGED
|
@@ -37,7 +37,8 @@ describe('createRenderState', () => {
|
|
|
37
37
|
expect(runtime.renderProxyAdapterMap).toStrictEqual(new WeakMap());
|
|
38
38
|
expect(runtime.registries).toStrictEqual({
|
|
39
39
|
renderers: createKeyedTable('NodeRenderer', 'Unregistered'),
|
|
40
|
-
|
|
40
|
+
// Present and null, not absent: the stable key set is what keeps the registries one hidden class.
|
|
41
|
+
strokeTessellator: null,
|
|
41
42
|
});
|
|
42
43
|
expect(runtime.rendererMapId).toStrictEqual(0);
|
|
43
44
|
expect(runtime.tempStack).toStrictEqual([]);
|
|
@@ -76,7 +77,8 @@ describe('createRenderStateRuntime', () => {
|
|
|
76
77
|
expect(runtime.renderProxyAdapterMap).toStrictEqual(new WeakMap());
|
|
77
78
|
expect(runtime.registries.colorAdjustments).toBeUndefined();
|
|
78
79
|
expect(runtime.registries.renderers).toStrictEqual(createKeyedTable('NodeRenderer', 'Unregistered'));
|
|
79
|
-
|
|
80
|
+
// Opt-in: the stroke kernel's slot is allocated by enable*StrokePathTessellation, never here.
|
|
81
|
+
expect(runtime.registries.strokeTessellator).toBeNull();
|
|
80
82
|
expect(runtime.rendererMapId).toStrictEqual(0);
|
|
81
83
|
expect(runtime.tempStack).toStrictEqual([]);
|
|
82
84
|
});
|
|
@@ -86,7 +88,6 @@ describe('createRenderStateRuntime', () => {
|
|
|
86
88
|
const b = createRenderStateRuntime();
|
|
87
89
|
expect(a).not.toBe(b);
|
|
88
90
|
expect(a.registries.renderers).not.toBe(b.registries.renderers);
|
|
89
|
-
expect(a.registries.strokeTessellator).not.toBe(b.registries.strokeTessellator);
|
|
90
91
|
});
|
|
91
92
|
});
|
|
92
93
|
|
package/src/renderer.test.ts
CHANGED
|
@@ -130,7 +130,7 @@ describe('copyRenderStateRegistrations', () => {
|
|
|
130
130
|
entry: { state: RegistryEntryState.Bound, value: colorAdjustmentUnsupportedGuard },
|
|
131
131
|
};
|
|
132
132
|
getRenderStateRuntime(source).registries.strokeTessellator = {
|
|
133
|
-
...
|
|
133
|
+
...createSlotTable('StrokeTessellator', 'Rasterize'),
|
|
134
134
|
entry: { state: RegistryEntryState.Bound, value: strokeTessellator },
|
|
135
135
|
};
|
|
136
136
|
getRenderStateRuntime(source).registries.renderRootGuard = {
|
|
@@ -171,15 +171,18 @@ describe('copyRenderStateRegistrations', () => {
|
|
|
171
171
|
expect(sourceRuntime.registries.colorAdjustmentUnsupportedGuard).not.toBe(sharedGuardSnapshot);
|
|
172
172
|
expect(targetRuntime.registries.colorAdjustmentUnsupportedGuard).toBe(sharedGuardSnapshot);
|
|
173
173
|
expect(targetRuntime.registries.strokeTessellator).toBe(sourceRuntime.registries.strokeTessellator);
|
|
174
|
-
expect(targetRuntime.registries.strokeTessellator
|
|
174
|
+
expect(targetRuntime.registries.strokeTessellator?.entry).toEqual({
|
|
175
175
|
state: RegistryEntryState.Bound,
|
|
176
176
|
value: strokeTessellator,
|
|
177
177
|
});
|
|
178
178
|
const sharedStrokeSnapshot = targetRuntime.registries.strokeTessellator;
|
|
179
|
-
sourceRuntime.registries.strokeTessellator = {
|
|
179
|
+
sourceRuntime.registries.strokeTessellator = {
|
|
180
|
+
...createSlotTable('StrokeTessellator', 'Rasterize'),
|
|
181
|
+
entry: null,
|
|
182
|
+
};
|
|
180
183
|
expect(sourceRuntime.registries.strokeTessellator).not.toBe(sharedStrokeSnapshot);
|
|
181
184
|
expect(targetRuntime.registries.strokeTessellator).toBe(sharedStrokeSnapshot);
|
|
182
|
-
expect(targetRuntime.registries.strokeTessellator
|
|
185
|
+
expect(targetRuntime.registries.strokeTessellator?.entry?.state).toBe(RegistryEntryState.Bound);
|
|
183
186
|
expect(targetRuntime.registries.effectPaddingResolvers).toBe(sourceRuntime.registries.effectPaddingResolvers);
|
|
184
187
|
expect(targetRuntime.registries.effectPaddingResolvers?.entries.get('acme.Effect')).toEqual({
|
|
185
188
|
state: RegistryEntryState.Bound,
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Raster2DSurface, Raster2DSurfaceCreator } from '@flighthq/types/contract';
|
|
2
|
-
export declare function createRaster2DSurface(provider: Readonly<Raster2DSurfaceCreator>, width: number, height: number): Raster2DSurface | null;
|
|
3
|
-
export declare function destroyRaster2DSurface(surface: Raster2DSurface): void;
|
|
4
|
-
//# sourceMappingURL=raster2DSurface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raster2DSurface.d.ts","sourceRoot":"","sources":["../src/raster2DSurface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAExF,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAC1C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,IAAI,CAIxB;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAKrE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raster2DSurface.js","sourceRoot":"","sources":["../src/raster2DSurface.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CACnC,QAA0C,EAC1C,KAAa,EACb,MAAc;IAEd,MAAM,OAAO,GAAG,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,IAAI,OAAO,KAAK,IAAI;QAAE,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/D,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,mGAAmG;AACnG,+FAA+F;AAC/F,8EAA8E;AAC9E,MAAM,UAAU,sBAAsB,CAAC,OAAwB;IAC7D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO;IACnC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAqD,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
|
-
import type { Entity, Raster2DSurface, Raster2DSurfaceCreator } from '@flighthq/types/contract';
|
|
3
|
-
|
|
4
|
-
import { createRaster2DSurface, destroyRaster2DSurface } from './raster2DSurface';
|
|
5
|
-
|
|
6
|
-
function entityProvider(fields: Omit<Raster2DSurfaceCreator, keyof Entity>): Raster2DSurfaceCreator {
|
|
7
|
-
return (() => {
|
|
8
|
-
const out = allocateEntity<any>();
|
|
9
|
-
Object.assign(out, fields);
|
|
10
|
-
return finishEntity(out);
|
|
11
|
-
})();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe('createRaster2DSurface', () => {
|
|
15
|
-
it('passes exact dimensions through the given provider and preserves its result', () => {
|
|
16
|
-
const surface = {} as Raster2DSurface;
|
|
17
|
-
const create = vi.fn(() => surface);
|
|
18
|
-
const provider = entityProvider({ createRaster2DSurface: create, destroyRaster2DSurface() {} });
|
|
19
|
-
|
|
20
|
-
expect(createRaster2DSurface(provider, 30, 40)).toBe(surface);
|
|
21
|
-
expect(create).toHaveBeenCalledOnce();
|
|
22
|
-
expect(create).toHaveBeenCalledWith(30, 40);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('preserves provider refusal as expected absence', () => {
|
|
26
|
-
const provider = entityProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
|
|
27
|
-
expect(createRaster2DSurface(provider, 10, 20)).toBeNull();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe('destroyRaster2DSurface', () => {
|
|
32
|
-
it('routes each surface to its creator even when different providers were used', () => {
|
|
33
|
-
const firstSurface = {} as Raster2DSurface;
|
|
34
|
-
const secondSurface = {} as Raster2DSurface;
|
|
35
|
-
const firstDestroy = vi.fn();
|
|
36
|
-
const secondDestroy = vi.fn();
|
|
37
|
-
const first = entityProvider({
|
|
38
|
-
createRaster2DSurface: () => firstSurface,
|
|
39
|
-
destroyRaster2DSurface: firstDestroy,
|
|
40
|
-
});
|
|
41
|
-
const second = entityProvider({
|
|
42
|
-
createRaster2DSurface: () => secondSurface,
|
|
43
|
-
destroyRaster2DSurface: secondDestroy,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
expect(createRaster2DSurface(first, 10, 20)).toBe(firstSurface);
|
|
47
|
-
expect(createRaster2DSurface(second, 30, 40)).toBe(secondSurface);
|
|
48
|
-
|
|
49
|
-
destroyRaster2DSurface(firstSurface);
|
|
50
|
-
destroyRaster2DSurface(secondSurface);
|
|
51
|
-
|
|
52
|
-
expect(firstDestroy).toHaveBeenCalledExactlyOnceWith(firstSurface);
|
|
53
|
-
expect(secondDestroy).toHaveBeenCalledExactlyOnceWith(secondSurface);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('is a no-op after the surface has been destroyed once', () => {
|
|
57
|
-
const surface = {} as Raster2DSurface;
|
|
58
|
-
const destroy = vi.fn();
|
|
59
|
-
const provider = entityProvider({
|
|
60
|
-
createRaster2DSurface: () => surface,
|
|
61
|
-
destroyRaster2DSurface: destroy,
|
|
62
|
-
});
|
|
63
|
-
expect(createRaster2DSurface(provider, 10, 20)).toBe(surface);
|
|
64
|
-
|
|
65
|
-
destroyRaster2DSurface(surface);
|
|
66
|
-
destroyRaster2DSurface(surface);
|
|
67
|
-
|
|
68
|
-
expect(destroy).toHaveBeenCalledOnce();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('is a no-op for an unknown surface', () => {
|
|
72
|
-
expect(() => destroyRaster2DSurface({} as Raster2DSurface)).not.toThrow();
|
|
73
|
-
});
|
|
74
|
-
});
|