@flighthq/render 0.5.0-next.1944.cd6b6e7 → 0.5.1-edge.638.d4dbd4e

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 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.0-next.1944.cd6b6e7](https://github.com/flighthq/flight/tree/cd6b6e71eb472b3a4249830a7743333f019fa7b7/packages/render)
17
- - [License](https://github.com/flighthq/flight/blob/cd6b6e71eb472b3a4249830a7743333f019fa7b7/LICENSE.md)
16
+ - [Source for @flighthq/render@0.5.1-edge.638.d4dbd4e](https://github.com/flighthq/flight/tree/d4dbd4e347dc8be10b180c85a766ab50333dcb51/packages/render)
17
+ - [License](https://github.com/flighthq/flight/blob/d4dbd4e347dc8be10b180c85a766ab50333dcb51/LICENSE.md)
@@ -10,6 +10,7 @@ export * from './renderMaterial';
10
10
  export * from './renderProxy';
11
11
  export * from './renderProxyAdapter';
12
12
  export * from './renderQueue';
13
+ export * from './raster2DSurface';
13
14
  export * from './explainScene2DCoverage';
14
15
  export * from './renderRegistryGuards';
15
16
  export * from './renderRegistrySignals';
@@ -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,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,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"}
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,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,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"}
package/dist/contract.js CHANGED
@@ -10,6 +10,7 @@ export * from './renderMaterial';
10
10
  export * from './renderProxy';
11
11
  export * from './renderProxyAdapter';
12
12
  export * from './renderQueue';
13
+ export * from './raster2DSurface';
13
14
  export * from './explainScene2DCoverage';
14
15
  export * from './renderRegistryGuards';
15
16
  export * from './renderRegistrySignals';
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/cont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,2BAA2B,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { areColorAdjustmentsEnabled, disableSceneRenderGuards, enableColorAdjustments, enableSceneRenderGuards, createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistryGuards, enableRenderRegistrySignals, explainRenderRegistryMisses, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
1
+ export { areColorAdjustmentsEnabled, createRaster2DSurface, destroyRaster2DSurface, disableSceneRenderGuards, enableColorAdjustments, enableSceneRenderGuards, createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistryGuards, enableRenderRegistrySignals, explainRaster2DSurfaceProvider, explainRenderRegistryMisses, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
2
2
  export { SCENE2D_WORKING_COLOR_SPACE } from './scene2dWorkingColorSpace';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,EAC3B,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, disableSceneRenderGuards, enableColorAdjustments, enableSceneRenderGuards, createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistryGuards, enableRenderRegistrySignals, explainRenderRegistryMisses, packScene3DLightBlock, prepareScene2DRender, prepareScene3DRender, registerRenderer, useRenderCache, } from './contract';
1
+ export { areColorAdjustmentsEnabled, createRaster2DSurface, destroyRaster2DSurface, disableSceneRenderGuards, enableColorAdjustments, enableSceneRenderGuards, createRenderCache, destroyRenderState, disposeScene2DRender, enableRenderRegistryGuards, enableRenderRegistrySignals, explainRaster2DSurfaceProvider, explainRenderRegistryMisses, 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,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { BackendExplanation, Raster2DSurface, Raster2DSurfaceProvider } from '@flighthq/types/contract';
2
+ export declare function createRaster2DSurface(width: number, height: number): Raster2DSurface | null;
3
+ export declare function destroyRaster2DSurface(surface: Raster2DSurface): void;
4
+ export declare function explainRaster2DSurfaceProvider(): BackendExplanation;
5
+ export declare function getRaster2DSurfaceProvider(): Readonly<Raster2DSurfaceProvider>;
6
+ export declare function hasRaster2DSurfaceHostProvider(): boolean;
7
+ export declare function installRaster2DSurfaceHostProvider(provider: Readonly<Raster2DSurfaceProvider>): void;
8
+ export declare function resetRaster2DSurfaceProviderForTest(): void;
9
+ export declare function setRaster2DSurfaceProvider(provider: Readonly<Raster2DSurfaceProvider> | null): void;
10
+ //# sourceMappingURL=raster2DSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raster2DSurface.d.ts","sourceRoot":"","sources":["../src/raster2DSurface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE7G,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAK3F;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAKrE;AAED,wBAAgB,8BAA8B,IAAI,kBAAkB,CAQnE;AAED,wBAAgB,0BAA0B,IAAI,QAAQ,CAAC,uBAAuB,CAAC,CAE9E;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAExD;AAED,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAMpG;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAI1D;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GAAG,IAAI,GAAG,IAAI,CAEnG"}
@@ -0,0 +1,59 @@
1
+ export function createRaster2DSurface(width, height) {
2
+ const provider = getRaster2DSurfaceProvider();
3
+ const surface = provider.createRaster2DSurface(width, height);
4
+ if (surface !== null)
5
+ _surfaceProviders.set(surface, provider);
6
+ return surface;
7
+ }
8
+ // A surface must return to the provider that allocated it even when process-global provider selection
9
+ // changes during its lifetime. Delete the ownership record before invoking the provider so repeated or
10
+ // reentrant destruction is a no-op and no non-GC resource can be freed twice.
11
+ export function destroyRaster2DSurface(surface) {
12
+ const provider = _surfaceProviders.get(surface);
13
+ if (provider === undefined)
14
+ return;
15
+ _surfaceProviders.delete(surface);
16
+ provider.destroyRaster2DSurface(surface);
17
+ }
18
+ export function explainRaster2DSurfaceProvider() {
19
+ if (_custom !== null) {
20
+ return { conflict: _hostConflict, layer: 'custom', operation: null, viability: 'unobserved' };
21
+ }
22
+ if (_host !== null) {
23
+ return { conflict: _hostConflict, layer: 'host', operation: null, viability: 'unobserved' };
24
+ }
25
+ return { conflict: false, layer: 'host-not-enabled', operation: null, viability: 'unobserved' };
26
+ }
27
+ export function getRaster2DSurfaceProvider() {
28
+ return _custom ?? _host ?? _sentinel;
29
+ }
30
+ export function hasRaster2DSurfaceHostProvider() {
31
+ return _host !== null;
32
+ }
33
+ export function installRaster2DSurfaceHostProvider(provider) {
34
+ if (_host !== null) {
35
+ if (_host !== provider)
36
+ _hostConflict = true;
37
+ return;
38
+ }
39
+ _host = provider;
40
+ }
41
+ export function resetRaster2DSurfaceProviderForTest() {
42
+ _custom = null;
43
+ _host = null;
44
+ _hostConflict = false;
45
+ }
46
+ export function setRaster2DSurfaceProvider(provider) {
47
+ _custom = provider;
48
+ }
49
+ const _sentinel = {
50
+ createRaster2DSurface() {
51
+ return null;
52
+ },
53
+ destroyRaster2DSurface() { },
54
+ };
55
+ const _surfaceProviders = new WeakMap();
56
+ let _custom = null;
57
+ let _host = null;
58
+ let _hostConflict = false;
59
+ //# sourceMappingURL=raster2DSurface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raster2DSurface.js","sourceRoot":"","sources":["../src/raster2DSurface.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,MAAc;IACjE,MAAM,QAAQ,GAAG,0BAA0B,EAAE,CAAC;IAC9C,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,sGAAsG;AACtG,uGAAuG;AACvG,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,UAAU,8BAA8B;IAC5C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CA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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
65
  case RenderRegistry.TextureResolver:
66
66
  if ('gl' in state)
67
- return 'resolveGlTexture: texture source kind has no registered resolver — call registerGlTextureResolver(state, sourceKind, resolver), or copyGlRenderStateRegistrations(offscreenState, screenState) after a late screen registration';
67
+ return 'resolveGlTexture: texture source kind has no registered resolver — rebuild the GlPipeline with the required resolver and create the render state from that pipeline';
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)
@@ -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;AAE3D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,UAAU,8BAA8B,CAAC,KAAkB;IAC/D,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAAkB;IAC3D,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO;IACjC,MAAM,OAAO,GAAG,EAAE,YAAY,CAAC;IAC/B,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9B,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5B,aAAa,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;QAClF,wBAAwB,CAA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,IAAI,KAAK;gBACnB,OAAO,oIAAoI,CAAC;YAC9I,IAAI,SAAS,IAAI,KAAK;gBACpB,OAAO,kIAAkI,CAAC;YAC5I,OAAO,mLAAmL,CAAC;IAC/L,CAAC;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAkB,EAAE,OAAe,EAAE,QAAwB,EAAE,IAAU;IACzG,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,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,4BAA4B,CAAC,KAAK,EAAE,QAAQ,CAAC;QACtD,QAAQ;KACT,EACD,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,OAAO,EAAuB,CAAC;AACrD,MAAM,YAAY,GAAG,IAAI,OAAO,EAAqC,CAAC;AACtE,IAAI,YAAY,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/render",
3
- "version": "0.5.0-next.1944.cd6b6e7",
3
+ "version": "0.5.1-edge.638.d4dbd4e",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,17 +38,17 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/adjustments": "0.5.0-next.1944.cd6b6e7",
42
- "@flighthq/color": "0.5.0-next.1944.cd6b6e7",
43
- "@flighthq/entity": "0.5.0-next.1944.cd6b6e7",
44
- "@flighthq/geometry": "0.5.0-next.1944.cd6b6e7",
45
- "@flighthq/log": "0.5.0-next.1944.cd6b6e7",
46
- "@flighthq/materials": "0.5.0-next.1944.cd6b6e7",
47
- "@flighthq/mesh": "0.5.0-next.1944.cd6b6e7",
48
- "@flighthq/node": "0.5.0-next.1944.cd6b6e7",
49
- "@flighthq/registry": "0.5.0-next.1944.cd6b6e7",
50
- "@flighthq/signals": "0.5.0-next.1944.cd6b6e7",
51
- "@flighthq/types": "0.5.0-next.1944.cd6b6e7"
41
+ "@flighthq/adjustments": "0.5.1-edge.638.d4dbd4e",
42
+ "@flighthq/color": "0.5.1-edge.638.d4dbd4e",
43
+ "@flighthq/entity": "0.5.1-edge.638.d4dbd4e",
44
+ "@flighthq/geometry": "0.5.1-edge.638.d4dbd4e",
45
+ "@flighthq/log": "0.5.1-edge.638.d4dbd4e",
46
+ "@flighthq/materials": "0.5.1-edge.638.d4dbd4e",
47
+ "@flighthq/mesh": "0.5.1-edge.638.d4dbd4e",
48
+ "@flighthq/node": "0.5.1-edge.638.d4dbd4e",
49
+ "@flighthq/registry": "0.5.1-edge.638.d4dbd4e",
50
+ "@flighthq/signals": "0.5.1-edge.638.d4dbd4e",
51
+ "@flighthq/types": "0.5.1-edge.638.d4dbd4e"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@flighthq/camera": "*",
@@ -0,0 +1,158 @@
1
+ import type { Raster2DSurface } from '@flighthq/types/contract';
2
+
3
+ import {
4
+ createRaster2DSurface,
5
+ destroyRaster2DSurface,
6
+ explainRaster2DSurfaceProvider,
7
+ getRaster2DSurfaceProvider,
8
+ hasRaster2DSurfaceHostProvider,
9
+ installRaster2DSurfaceHostProvider,
10
+ resetRaster2DSurfaceProviderForTest,
11
+ setRaster2DSurfaceProvider,
12
+ } from './raster2DSurface';
13
+
14
+ afterEach(() => {
15
+ resetRaster2DSurfaceProviderForTest();
16
+ });
17
+
18
+ describe('createRaster2DSurface', () => {
19
+ it('passes exact dimensions through the selected provider and preserves its result', () => {
20
+ const surface = {} as Raster2DSurface;
21
+ const createSurface = vi.fn(() => surface);
22
+ setRaster2DSurfaceProvider({ createRaster2DSurface: createSurface, destroyRaster2DSurface() {} });
23
+
24
+ expect(createRaster2DSurface(30, 40)).toBe(surface);
25
+ expect(createSurface).toHaveBeenCalledOnce();
26
+ expect(createSurface).toHaveBeenCalledWith(30, 40);
27
+ });
28
+
29
+ it('preserves provider refusal as expected absence', () => {
30
+ setRaster2DSurfaceProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
31
+ expect(createRaster2DSurface(10, 20)).toBeNull();
32
+ });
33
+ });
34
+
35
+ describe('destroyRaster2DSurface', () => {
36
+ it('routes each surface to its creator after the selected provider changes', () => {
37
+ const firstSurface = {} as Raster2DSurface;
38
+ const secondSurface = {} as Raster2DSurface;
39
+ const firstDestroy = vi.fn();
40
+ const secondDestroy = vi.fn();
41
+ setRaster2DSurfaceProvider({
42
+ createRaster2DSurface: () => firstSurface,
43
+ destroyRaster2DSurface: firstDestroy,
44
+ });
45
+ expect(createRaster2DSurface(10, 20)).toBe(firstSurface);
46
+
47
+ setRaster2DSurfaceProvider({
48
+ createRaster2DSurface: () => secondSurface,
49
+ destroyRaster2DSurface: secondDestroy,
50
+ });
51
+ expect(createRaster2DSurface(30, 40)).toBe(secondSurface);
52
+
53
+ destroyRaster2DSurface(firstSurface);
54
+ destroyRaster2DSurface(secondSurface);
55
+
56
+ expect(firstDestroy).toHaveBeenCalledExactlyOnceWith(firstSurface);
57
+ expect(secondDestroy).toHaveBeenCalledExactlyOnceWith(secondSurface);
58
+ });
59
+
60
+ it('is a no-op after the creator has destroyed the surface once', () => {
61
+ const surface = {} as Raster2DSurface;
62
+ const destroySurface = vi.fn();
63
+ setRaster2DSurfaceProvider({
64
+ createRaster2DSurface: () => surface,
65
+ destroyRaster2DSurface: destroySurface,
66
+ });
67
+ expect(createRaster2DSurface(10, 20)).toBe(surface);
68
+
69
+ destroyRaster2DSurface(surface);
70
+ destroyRaster2DSurface(surface);
71
+
72
+ expect(destroySurface).toHaveBeenCalledOnce();
73
+ });
74
+ });
75
+
76
+ describe('explainRaster2DSurfaceProvider', () => {
77
+ it('reports the stable sentinel as host-not-enabled', () => {
78
+ expect(explainRaster2DSurfaceProvider()).toEqual({
79
+ conflict: false,
80
+ layer: 'host-not-enabled',
81
+ operation: null,
82
+ viability: 'unobserved',
83
+ });
84
+ });
85
+
86
+ it('reports a competing host installation without replacing the first host', () => {
87
+ const first = { createRaster2DSurface: () => null, destroyRaster2DSurface() {} };
88
+ const second = { createRaster2DSurface: () => null, destroyRaster2DSurface() {} };
89
+ installRaster2DSurfaceHostProvider(first);
90
+ installRaster2DSurfaceHostProvider(second);
91
+
92
+ expect(explainRaster2DSurfaceProvider()).toMatchObject({ conflict: true, layer: 'host' });
93
+ });
94
+ });
95
+
96
+ describe('getRaster2DSurfaceProvider', () => {
97
+ it('uses one stable null-returning sentinel when no provider is installed', () => {
98
+ const sentinel = getRaster2DSurfaceProvider();
99
+ expect(getRaster2DSurfaceProvider()).toBe(sentinel);
100
+ expect(sentinel.createRaster2DSurface(10, 20)).toBeNull();
101
+ });
102
+
103
+ it('selects a custom provider over the host provider', () => {
104
+ const host = { createRaster2DSurface: () => null, destroyRaster2DSurface() {} };
105
+ const custom = { createRaster2DSurface: () => null, destroyRaster2DSurface() {} };
106
+ installRaster2DSurfaceHostProvider(host);
107
+ setRaster2DSurfaceProvider(custom);
108
+
109
+ expect(getRaster2DSurfaceProvider()).toBe(custom);
110
+ });
111
+ });
112
+
113
+ describe('hasRaster2DSurfaceHostProvider', () => {
114
+ it('reports only the host slot', () => {
115
+ setRaster2DSurfaceProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
116
+ expect(hasRaster2DSurfaceHostProvider()).toBe(false);
117
+ installRaster2DSurfaceHostProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
118
+ expect(hasRaster2DSurfaceHostProvider()).toBe(true);
119
+ });
120
+ });
121
+
122
+ describe('installRaster2DSurfaceHostProvider', () => {
123
+ it('keeps the first host provider', () => {
124
+ const first = { createRaster2DSurface: () => null, destroyRaster2DSurface() {} };
125
+ installRaster2DSurfaceHostProvider(first);
126
+ installRaster2DSurfaceHostProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
127
+
128
+ expect(getRaster2DSurfaceProvider()).toBe(first);
129
+ });
130
+ });
131
+
132
+ describe('resetRaster2DSurfaceProviderForTest', () => {
133
+ it('clears custom, host, and conflict state', () => {
134
+ installRaster2DSurfaceHostProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
135
+ installRaster2DSurfaceHostProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
136
+ setRaster2DSurfaceProvider({ createRaster2DSurface: () => null, destroyRaster2DSurface() {} });
137
+
138
+ resetRaster2DSurfaceProviderForTest();
139
+
140
+ expect(hasRaster2DSurfaceHostProvider()).toBe(false);
141
+ expect(explainRaster2DSurfaceProvider()).toMatchObject({ conflict: false, layer: 'host-not-enabled' });
142
+ });
143
+ });
144
+
145
+ describe('setRaster2DSurfaceProvider', () => {
146
+ it('reveals the host provider again when custom is cleared', () => {
147
+ const hostSurface = { width: 1 } as Raster2DSurface;
148
+ const customSurface = { width: 2 } as Raster2DSurface;
149
+ const host = { createRaster2DSurface: () => hostSurface, destroyRaster2DSurface() {} };
150
+ installRaster2DSurfaceHostProvider(host);
151
+ setRaster2DSurfaceProvider({ createRaster2DSurface: () => customSurface, destroyRaster2DSurface() {} });
152
+
153
+ expect(createRaster2DSurface(1, 1)).toBe(customSurface);
154
+ setRaster2DSurfaceProvider(null);
155
+ expect(getRaster2DSurfaceProvider()).toBe(host);
156
+ expect(createRaster2DSurface(1, 1)).toBe(hostSurface);
157
+ });
158
+ });