@jbrowse/render-core 5.0.0-beta.1 → 5.0.0-beta.3
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/esm/RenderLifecycleMixin.d.ts +25 -6
- package/esm/RenderLifecycleMixin.js +30 -7
- package/esm/canvas2dUtils.d.ts +25 -0
- package/esm/canvas2dUtils.js +27 -0
- package/esm/colorRampLut.d.ts +4 -4
- package/esm/colorRampLut.js +4 -4
- package/esm/computePipeline.d.ts +13 -0
- package/esm/computePipeline.js +55 -0
- package/esm/contractReports.d.ts +54 -0
- package/esm/contractReports.js +112 -0
- package/esm/coverageBand.d.ts +0 -1
- package/esm/coverageBand.js +0 -1
- package/esm/coverageBandBuffers.d.ts +0 -6
- package/esm/coverageBandBuffers.js +1 -13
- package/esm/createRenderingBackend.d.ts +14 -18
- package/esm/createRenderingBackend.js +4 -2
- package/esm/displayPhase.d.ts +10 -1
- package/esm/displayPhase.js +2 -1
- package/esm/encodeMemo.d.ts +14 -0
- package/esm/encodeMemo.js +48 -0
- package/esm/gpuDevice.d.ts +9 -0
- package/esm/gpuDevice.js +12 -3
- package/esm/graphicsCapabilities.d.ts +18 -15
- package/esm/graphicsCapabilities.js +23 -16
- package/esm/hal/createHal.d.ts +1 -2
- package/esm/hal/createHal.js +14 -4
- package/esm/hal/deviceGpuCache.js +2 -2
- package/esm/hal/gpuHalBase.d.ts +1 -1
- package/esm/hal/gpuHalBase.js +2 -3
- package/esm/hal/mockHal.d.ts +0 -1
- package/esm/hal/mockHal.js +0 -10
- package/esm/hal/regionRegistry.d.ts +0 -1
- package/esm/hal/regionRegistry.js +3 -15
- package/esm/hal/types.d.ts +5 -1
- package/esm/hal/webgl2Hal.d.ts +1 -1
- package/esm/hal/webgl2Hal.js +2 -2
- package/esm/hal/webgpuHal.d.ts +2 -2
- package/esm/hal/webgpuHal.js +13 -10
- package/esm/installUpload.d.ts +4 -1
- package/esm/installUpload.js +10 -41
- package/esm/instanceCache.d.ts +10 -7
- package/esm/instanceCache.js +14 -15
- package/esm/mapUploadSync.d.ts +0 -8
- package/esm/mapUploadSync.js +0 -1
- package/esm/marks/colorFill.d.ts +17 -0
- package/esm/marks/colorFill.js +26 -0
- package/esm/marks/drawAgainstHit.d.ts +47 -0
- package/esm/marks/drawAgainstHit.js +140 -0
- package/esm/marks/glyphPaint.d.ts +16 -0
- package/esm/marks/glyphPaint.js +41 -0
- package/esm/marks/index.d.ts +9 -0
- package/esm/marks/index.js +6 -0
- package/esm/marks/markBackend.d.ts +87 -0
- package/esm/marks/markBackend.js +133 -0
- package/esm/marks/markPaint.d.ts +13 -0
- package/esm/marks/markPaint.js +18 -0
- package/esm/marks/pointMark.d.ts +24 -0
- package/esm/marks/pointMark.js +98 -0
- package/esm/marks/spanMark.d.ts +45 -0
- package/esm/marks/spanMark.js +71 -0
- package/esm/marks/types.d.ts +206 -0
- package/esm/marks/types.js +125 -0
- package/esm/perRegionRenderingBackend.d.ts +15 -3
- package/esm/perRegionRenderingBackend.js +26 -3
- package/esm/regionDataMap.d.ts +2 -2
- package/esm/regionDataMap.js +25 -23
- package/esm/renderingBackendBase.d.ts +11 -14
- package/esm/renderingBackendBase.js +7 -7
- package/esm/shaders/capsule.js.generated.d.ts +1 -0
- package/esm/shaders/capsule.js.generated.js +11 -0
- package/esm/shaders/coverageBar.generated.d.ts +2 -2
- package/esm/shaders/coverageBar.generated.js +2 -2
- package/esm/shaders/coverageMod.generated.d.ts +2 -2
- package/esm/shaders/coverageMod.generated.js +2 -2
- package/esm/shaders/coverageSnp.generated.d.ts +2 -2
- package/esm/shaders/coverageSnp.generated.js +2 -2
- package/esm/shaders/hpmath.js.generated.d.ts +1 -0
- package/esm/shaders/hpmath.js.generated.js +4 -1
- package/esm/shaders/pointMark.consts.generated.d.ts +4 -0
- package/esm/shaders/pointMark.consts.generated.js +6 -0
- package/esm/shaders/pointMark.generated.d.ts +5 -0
- package/esm/shaders/pointMark.generated.js +7 -0
- package/esm/shaders/pointMark.iface.generated.d.ts +55 -0
- package/esm/shaders/pointMark.iface.generated.js +100 -0
- package/esm/shaders/pointMark.js.generated.d.ts +1 -0
- package/esm/shaders/pointMark.js.generated.js +16 -0
- package/esm/shaders/rowRect.generated.d.ts +0 -1
- package/esm/shaders/rowRect.generated.js +0 -1
- package/esm/shaders/spanMark.generated.d.ts +4 -0
- package/esm/shaders/spanMark.generated.js +6 -0
- package/esm/shaders/spanMark.iface.generated.d.ts +58 -0
- package/esm/shaders/spanMark.iface.generated.js +122 -0
- package/esm/sharedBackendKey.d.ts +18 -0
- package/esm/{keyedRenderingBackend.js → sharedBackendKey.js} +5 -0
- package/esm/slangPass.d.ts +2 -0
- package/esm/slangPass.js +2 -0
- package/package.json +14 -4
- package/src/shaders/capsule.js.generated.ts +14 -0
- package/src/shaders/capsule.slang +12 -4
- package/src/shaders/colorPack.slang +5 -1
- package/src/shaders/coverageBand.slang +38 -15
- package/src/shaders/coverageBar.generated.ts +2 -2
- package/src/shaders/coverageBar.slang +9 -0
- package/src/shaders/coverageMod.generated.ts +2 -2
- package/src/shaders/coverageSnp.generated.ts +2 -2
- package/src/shaders/hpmath.js.generated.ts +5 -1
- package/src/shaders/hpmath.slang +29 -10
- package/src/shaders/pointMark.consts.generated.ts +10 -0
- package/src/shaders/pointMark.generated.ts +12 -0
- package/src/shaders/pointMark.iface.generated.ts +146 -0
- package/src/shaders/pointMark.js.generated.ts +21 -0
- package/src/shaders/pointMark.slang +192 -0
- package/src/shaders/rowRect.generated.ts +0 -2
- package/src/shaders/rowRect.slang +33 -44
- package/src/shaders/spanMark.generated.ts +10 -0
- package/src/shaders/spanMark.iface.generated.ts +168 -0
- package/src/shaders/spanMark.slang +22 -0
- package/esm/globalRenderingBackend.d.ts +0 -90
- package/esm/globalRenderingBackend.js +0 -53
- package/esm/keyedRenderingBackend.d.ts +0 -41
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { prepareCanvas } from './canvas2dUtils.js';
|
|
2
|
-
import { Canvas2DRenderingBackendBase, GpuRenderingBackendBase, } from './renderingBackendBase.js';
|
|
3
|
-
/**
|
|
4
|
-
* Canvas2D-side base for `GlobalRenderingBackend` implementations. Inherits the
|
|
5
|
-
* `canvas` + 2D context (and no-op `dispose`) from
|
|
6
|
-
* `Canvas2DRenderingBackendBase`; stubs `upload` (no-op — data flows through
|
|
7
|
-
* `render`).
|
|
8
|
-
*
|
|
9
|
-
* `render` is concrete and runs `prepareCanvas` (DPR-aware backing-store sizing)
|
|
10
|
-
* before handing off to the abstract `draw`, exactly as
|
|
11
|
-
* `Canvas2DPerRegionRenderingBackend` does — so a renderer here can no more
|
|
12
|
-
* forget it and paint blurry on hi-DPI than one over there can. All three
|
|
13
|
-
* subclasses opened with that same call and none of them had to.
|
|
14
|
-
*
|
|
15
|
-
* A null payload still prepares (and so clears) the canvas, then skips the
|
|
16
|
-
* draw: that is the frame where a refetch is in flight and the old picture must
|
|
17
|
-
* not stay up.
|
|
18
|
-
*/
|
|
19
|
-
export class Canvas2DGlobalRenderingBackend extends Canvas2DRenderingBackendBase {
|
|
20
|
-
upload(_key, _cell) { }
|
|
21
|
-
release(_key) { }
|
|
22
|
-
render(data, state) {
|
|
23
|
-
prepareCanvas(this.canvas, this.ctx, state.canvasWidth, state.canvasHeight);
|
|
24
|
-
return data !== null && this.draw(data, state);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* GPU-side base for `GlobalRenderingBackend` implementations. Inherits the
|
|
29
|
-
* `hal` reference, the pre-allocated uniform scratch buffer, and the
|
|
30
|
-
* HAL-delegating `dispose` from `GpuRenderingBackendBase`. Subclasses implement
|
|
31
|
-
* `upload` and `draw`.
|
|
32
|
-
*
|
|
33
|
-
* `render` is the frame scaffold the per-region base has always had and this
|
|
34
|
-
* one did not: resize the backing store, `beginFrame`/`endFrame`, and hand the
|
|
35
|
-
* middle to `draw`. **The pairing is the point.** `beginFrame` is what clears
|
|
36
|
-
* the canvas, so a frame that draws nothing still has to open and close one or
|
|
37
|
-
* the last picture stays up — and with each subclass writing its own scaffold,
|
|
38
|
-
* that invariant held three times by hand.
|
|
39
|
-
*
|
|
40
|
-
* `release` is a no-op by default: a payload leaving the map is answered by
|
|
41
|
-
* `render` being handed `null`, and `beginFrame` clears the last picture. A
|
|
42
|
-
* subclass whose buffers are worth freeing early overrides it.
|
|
43
|
-
*/
|
|
44
|
-
export class GpuGlobalRenderingBackend extends GpuRenderingBackendBase {
|
|
45
|
-
release() { }
|
|
46
|
-
render(data, state) {
|
|
47
|
-
this.hal.resize(state.canvasWidth, state.canvasHeight);
|
|
48
|
-
this.hal.beginFrame(0, 0, 0, 0);
|
|
49
|
-
const painted = data !== null && this.draw(data, state);
|
|
50
|
-
this.hal.endFrame();
|
|
51
|
-
return painted;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { RenderingBackend } from './renderingBackendBase.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Shared contract for **keyed shared-canvas** backends — one canvas painting
|
|
4
|
-
* several displays at once, each holding its own uploaded buffer under its own
|
|
5
|
-
* key. Dotplot (a key per display in the view) and multi-LGV synteny (a key per
|
|
6
|
-
* track level) are the two.
|
|
7
|
-
*
|
|
8
|
-
* The third shape beside per-region and monolithic, and genuinely neither:
|
|
9
|
-
* per-region drives off `renderBlocks(blocks, regions, state)` with the model's
|
|
10
|
-
* data map handed back each frame, and monolithic is one payload under the `data` key
|
|
11
|
-
* with no key at all. These key their uploads and render every key in one
|
|
12
|
-
* frame from state the caller assembled, so they own the map.
|
|
13
|
-
*
|
|
14
|
-
* Unlike the other two this is an interface with no abstract class under it:
|
|
15
|
-
* the shared *state* (`hal` + uniform scratch, or `canvas` + 2D context) is
|
|
16
|
-
* `GpuRenderingBackendBase` / `Canvas2DRenderingBackendBase`, which every keyed
|
|
17
|
-
* backend extends, and there is no shared *behavior* on top — the render loops
|
|
18
|
-
* genuinely differ. An empty abstract class between them would only be a place
|
|
19
|
-
* to look.
|
|
20
|
-
*/
|
|
21
|
-
export interface KeyedRenderingBackend<UploadData, RenderState> extends RenderingBackend {
|
|
22
|
-
/** CSS-pixel size of the shared canvas. */
|
|
23
|
-
resize(width: number, height: number): void;
|
|
24
|
-
upload(key: number, data: UploadData): void;
|
|
25
|
-
release(key: number): void;
|
|
26
|
-
/** Paint every key the state names. */
|
|
27
|
-
render(state: RenderState): void;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Stable 32-bit slot for a display on a backend it shares with siblings, hashed
|
|
31
|
-
* from its MST node id (djb2). Collisions are vanishingly rare at display
|
|
32
|
-
* cardinalities, and the alternative — coordinating integer slots between
|
|
33
|
-
* displays that don't know about each other — is worse.
|
|
34
|
-
*
|
|
35
|
-
* Key by this, never by the display's index in its parent's list. An index
|
|
36
|
-
* renumbers when a sibling is hidden or reordered, which hands the survivor a
|
|
37
|
-
* slot holding another display's bytes: the keyed diff sees a changed
|
|
38
|
-
* reference and re-uploads every later display's whole buffer, and any frame
|
|
39
|
-
* drawn between the two mistakes one display's geometry for another's.
|
|
40
|
-
*/
|
|
41
|
-
export declare function sharedBackendKey(id: string): number;
|