@flighthq/scene2d-wgpu 0.5.1-next.731.0ae0aa4 → 0.5.1-next.799.62ef0c7
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/package.json +20 -20
- package/src/wgpuCache.test.ts +1 -0
- package/src/wgpuColorAdjustmentMaterialFeature.test.ts +2 -0
- package/src/wgpuParticleEmitter2D.test.ts +2 -1
- package/src/wgpuQuadBatchWriter.test.ts +2 -1
- package/src/wgpuRasterShapeRenderer.test.ts +3 -1
- package/src/wgpuRichText.test.ts +3 -0
- package/src/wgpuScale9Shape.test.ts +4 -0
- package/src/wgpuShape.test.ts +3 -1
- package/src/wgpuShapeData.test.ts +3 -0
- package/src/wgpuTextLabel.test.ts +3 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/scene2d-wgpu`. The `
|
|
|
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/scene2d-wgpu@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/scene2d-wgpu@0.5.1-next.799.62ef0c7](https://github.com/flighthq/flight/tree/62ef0c74f09f24177aac3695b2487b2d743d4fe6/packages/scene2d-wgpu)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/62ef0c74f09f24177aac3695b2487b2d743d4fe6/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/scene2d-wgpu",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.799.62ef0c7",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,25 +38,25 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/color": "0.5.1-next.
|
|
42
|
-
"@flighthq/entity": "0.5.1-next.
|
|
43
|
-
"@flighthq/scene2d": "0.5.1-next.
|
|
44
|
-
"@flighthq/scene2d-canvas": "0.5.1-next.
|
|
45
|
-
"@flighthq/geometry": "0.5.1-next.
|
|
46
|
-
"@flighthq/image": "0.5.1-next.
|
|
47
|
-
"@flighthq/log": "0.5.1-next.
|
|
48
|
-
"@flighthq/node": "0.5.1-next.
|
|
49
|
-
"@flighthq/path": "0.5.1-next.
|
|
50
|
-
"@flighthq/registry": "0.5.1-next.
|
|
51
|
-
"@flighthq/render": "0.5.1-next.
|
|
52
|
-
"@flighthq/render-wgpu": "0.5.1-next.
|
|
53
|
-
"@flighthq/shape": "0.5.1-next.
|
|
54
|
-
"@flighthq/text": "0.5.1-next.
|
|
55
|
-
"@flighthq/textinput": "0.5.1-next.
|
|
56
|
-
"@flighthq/textlayout": "0.5.1-next.
|
|
57
|
-
"@flighthq/texture": "0.5.1-next.
|
|
58
|
-
"@flighthq/types": "0.5.1-next.
|
|
59
|
-
"@flighthq/velocity": "0.5.1-next.
|
|
41
|
+
"@flighthq/color": "0.5.1-next.799.62ef0c7",
|
|
42
|
+
"@flighthq/entity": "0.5.1-next.799.62ef0c7",
|
|
43
|
+
"@flighthq/scene2d": "0.5.1-next.799.62ef0c7",
|
|
44
|
+
"@flighthq/scene2d-canvas": "0.5.1-next.799.62ef0c7",
|
|
45
|
+
"@flighthq/geometry": "0.5.1-next.799.62ef0c7",
|
|
46
|
+
"@flighthq/image": "0.5.1-next.799.62ef0c7",
|
|
47
|
+
"@flighthq/log": "0.5.1-next.799.62ef0c7",
|
|
48
|
+
"@flighthq/node": "0.5.1-next.799.62ef0c7",
|
|
49
|
+
"@flighthq/path": "0.5.1-next.799.62ef0c7",
|
|
50
|
+
"@flighthq/registry": "0.5.1-next.799.62ef0c7",
|
|
51
|
+
"@flighthq/render": "0.5.1-next.799.62ef0c7",
|
|
52
|
+
"@flighthq/render-wgpu": "0.5.1-next.799.62ef0c7",
|
|
53
|
+
"@flighthq/shape": "0.5.1-next.799.62ef0c7",
|
|
54
|
+
"@flighthq/text": "0.5.1-next.799.62ef0c7",
|
|
55
|
+
"@flighthq/textinput": "0.5.1-next.799.62ef0c7",
|
|
56
|
+
"@flighthq/textlayout": "0.5.1-next.799.62ef0c7",
|
|
57
|
+
"@flighthq/texture": "0.5.1-next.799.62ef0c7",
|
|
58
|
+
"@flighthq/types": "0.5.1-next.799.62ef0c7",
|
|
59
|
+
"@flighthq/velocity": "0.5.1-next.799.62ef0c7"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@webgpu/types": "^0.1.70"
|
package/src/wgpuCache.test.ts
CHANGED
|
@@ -90,6 +90,7 @@ beforeEach(() => {
|
|
|
90
90
|
vi.spyOn(renderWgpu, 'setWgpuRenderTransform2D').mockImplementation((() => {}) as never);
|
|
91
91
|
vi.spyOn(renderWgpu, 'createWgpuRenderTarget').mockImplementation(
|
|
92
92
|
((_state: unknown, width: number, height: number): WgpuRenderTarget => ({
|
|
93
|
+
[EntityRuntimeKey]: undefined,
|
|
93
94
|
bindings: new Map(),
|
|
94
95
|
mipLevelCount: 1,
|
|
95
96
|
colorSpace: 'srgb',
|
|
@@ -3,6 +3,7 @@ import { getWgpuColorAdjustmentMaterialFeature, getWgpuRenderStateRuntime } from
|
|
|
3
3
|
import { createWgpuRenderStateForTest, installWgpuMock } from '@flighthq/render-wgpu/contract';
|
|
4
4
|
import { areColorAdjustmentsEnabled } from '@flighthq/render/contract';
|
|
5
5
|
import type { ColorScaleBias } from '@flighthq/types/contract';
|
|
6
|
+
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
6
7
|
|
|
7
8
|
import { registerWgpuColorAdjustmentMaterialFeature } from './wgpuColorAdjustmentMaterialFeature';
|
|
8
9
|
import {
|
|
@@ -119,6 +120,7 @@ describe('registerWgpuColorAdjustmentMaterialFeature', () => {
|
|
|
119
120
|
renderWgpuBackground(state);
|
|
120
121
|
const runtime = getWgpuRenderStateRuntime(state);
|
|
121
122
|
const tex = {
|
|
123
|
+
[EntityRuntimeKey]: undefined,
|
|
122
124
|
bindings: new Map(),
|
|
123
125
|
mipLevelCount: 1,
|
|
124
126
|
texture: {} as GPUTexture,
|
|
@@ -9,7 +9,7 @@ import { createWgpuRenderStateForTest, installWgpuMock } from '@flighthq/render-
|
|
|
9
9
|
import { getRenderProxy2D, prepareScene2DRender } from '@flighthq/render/contract';
|
|
10
10
|
import { createTexture } from '@flighthq/texture/contract';
|
|
11
11
|
import type { CompressedImageResource, RenderProxy2D } from '@flighthq/types/contract';
|
|
12
|
-
import { CompressedImageTextureSourceKind, RegistryEntryState } from '@flighthq/types/contract';
|
|
12
|
+
import { CompressedImageTextureSourceKind, EntityRuntimeKey, RegistryEntryState } from '@flighthq/types/contract';
|
|
13
13
|
|
|
14
14
|
import { defaultWgpuParticleEmitter2DRenderer, drawWgpuParticleEmitter2D } from './wgpuParticleEmitter2D';
|
|
15
15
|
|
|
@@ -65,6 +65,7 @@ describe('drawWgpuParticleEmitter2D', () => {
|
|
|
65
65
|
});
|
|
66
66
|
const view = texture.createView();
|
|
67
67
|
return {
|
|
68
|
+
[EntityRuntimeKey]: undefined,
|
|
68
69
|
bindings: new Map(),
|
|
69
70
|
mipLevelCount: 1,
|
|
70
71
|
straightAlpha: true,
|
|
@@ -2,7 +2,7 @@ import { renderWgpuBackground, submitWgpuRenderPass } from '@flighthq/render-wgp
|
|
|
2
2
|
import { getWgpuRenderStateRuntime } from '@flighthq/render-wgpu/contract';
|
|
3
3
|
import { createWgpuRenderStateForTest, installWgpuMock } from '@flighthq/render-wgpu/contract';
|
|
4
4
|
import type { ColorScaleBias, Material, WgpuTextureEntry } from '@flighthq/types/contract';
|
|
5
|
-
import { BlendMode } from '@flighthq/types/contract';
|
|
5
|
+
import { BlendMode, EntityRuntimeKey } from '@flighthq/types/contract';
|
|
6
6
|
|
|
7
7
|
import { registerWgpuColorAdjustmentMaterialFeature } from './wgpuColorAdjustmentMaterialFeature';
|
|
8
8
|
import {
|
|
@@ -27,6 +27,7 @@ function makeMaterial(): Material {
|
|
|
27
27
|
|
|
28
28
|
function makeTexture(): WgpuTextureEntry {
|
|
29
29
|
return {
|
|
30
|
+
[EntityRuntimeKey]: undefined,
|
|
30
31
|
bindings: new Map(),
|
|
31
32
|
mipLevelCount: 1,
|
|
32
33
|
texture: {} as GPUTexture,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@flighthq/render/contract';
|
|
11
11
|
import { appendShapeBeginFill, appendShapeEndFill, appendShapeRectangle, createShape } from '@flighthq/shape/contract';
|
|
12
12
|
import type { RenderProxy2D } from '@flighthq/types/contract';
|
|
13
|
-
import { BatchFormat, RenderRegistry } from '@flighthq/types/contract';
|
|
13
|
+
import { BatchFormat, EntityRuntimeKey, RenderRegistry } from '@flighthq/types/contract';
|
|
14
14
|
|
|
15
15
|
import { defaultWgpuRasterShapeRenderer, drawWgpuRasterShape } from './wgpuRasterShapeRenderer';
|
|
16
16
|
import { registerWgpuShapeRasterizer } from './wgpuShapeRasterizer';
|
|
@@ -32,12 +32,14 @@ beforeEach(() => {
|
|
|
32
32
|
|
|
33
33
|
beforeEach(() => {
|
|
34
34
|
setRaster2DSurfaceProvider({
|
|
35
|
+
[EntityRuntimeKey]: undefined,
|
|
35
36
|
createRaster2DSurface(width, height) {
|
|
36
37
|
const canvas = document.createElement('canvas');
|
|
37
38
|
canvas.width = width;
|
|
38
39
|
canvas.height = height;
|
|
39
40
|
const context = canvas.getContext('2d')!;
|
|
40
41
|
return {
|
|
42
|
+
[EntityRuntimeKey]: undefined,
|
|
41
43
|
get width() {
|
|
42
44
|
return canvas.width;
|
|
43
45
|
},
|
package/src/wgpuRichText.test.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { createRichText } from '@flighthq/text/contract';
|
|
11
11
|
import { enableTextInput } from '@flighthq/textinput/contract';
|
|
12
12
|
import type { Raster2DSurface } from '@flighthq/types/contract';
|
|
13
|
+
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
13
14
|
|
|
14
15
|
import { getWgpuRendererData } from './wgpuRendererData';
|
|
15
16
|
import {
|
|
@@ -35,6 +36,7 @@ function createTestRaster2DSurface(width: number, height: number): Raster2DSurfa
|
|
|
35
36
|
canvas.height = height;
|
|
36
37
|
const context = canvas.getContext('2d')!;
|
|
37
38
|
return {
|
|
39
|
+
[EntityRuntimeKey]: undefined,
|
|
38
40
|
get width() {
|
|
39
41
|
return canvas.width;
|
|
40
42
|
},
|
|
@@ -56,6 +58,7 @@ function installTestRaster2DSurfaceProvider(
|
|
|
56
58
|
destroyRaster2DSurface: (surface: Raster2DSurface) => void = () => {},
|
|
57
59
|
): void {
|
|
58
60
|
setRaster2DSurfaceProvider({
|
|
61
|
+
[EntityRuntimeKey]: undefined,
|
|
59
62
|
createRaster2DSurface(width, height) {
|
|
60
63
|
return createTestRaster2DSurface(width, height);
|
|
61
64
|
},
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '@flighthq/render/contract';
|
|
15
15
|
import { appendShapeBeginFill, appendShapeRectangle, createScale9Shape } from '@flighthq/shape/contract';
|
|
16
16
|
import type { Raster2DSurface } from '@flighthq/types/contract';
|
|
17
|
+
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
17
18
|
|
|
18
19
|
import {
|
|
19
20
|
acquireWgpuScale9ShapeRasterSurface,
|
|
@@ -34,6 +35,7 @@ function createTestSurface(width = 1, height = 1): Raster2DSurface {
|
|
|
34
35
|
canvas.height = height;
|
|
35
36
|
const context = canvas.getContext('2d')!;
|
|
36
37
|
return {
|
|
38
|
+
[EntityRuntimeKey]: undefined,
|
|
37
39
|
get width() {
|
|
38
40
|
return canvas.width;
|
|
39
41
|
},
|
|
@@ -58,6 +60,7 @@ beforeAll(() => {
|
|
|
58
60
|
beforeEach(() => {
|
|
59
61
|
destroySurface.mockReset();
|
|
60
62
|
setRaster2DSurfaceProvider({
|
|
63
|
+
[EntityRuntimeKey]: undefined,
|
|
61
64
|
createRaster2DSurface: createTestSurface,
|
|
62
65
|
destroyRaster2DSurface: destroySurface,
|
|
63
66
|
});
|
|
@@ -72,6 +75,7 @@ describe('acquireWgpuScale9ShapeRasterSurface', () => {
|
|
|
72
75
|
const surface = createTestSurface();
|
|
73
76
|
const createSurface = vi.fn().mockReturnValueOnce(null).mockReturnValue(surface);
|
|
74
77
|
setRaster2DSurfaceProvider({
|
|
78
|
+
[EntityRuntimeKey]: undefined,
|
|
75
79
|
createRaster2DSurface: createSurface,
|
|
76
80
|
destroyRaster2DSurface: destroySurface,
|
|
77
81
|
});
|
package/src/wgpuShape.test.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
createShape,
|
|
16
16
|
} from '@flighthq/shape/contract';
|
|
17
17
|
import type { RenderProxy2D } from '@flighthq/types/contract';
|
|
18
|
-
import { BatchFormat, PathCommand } from '@flighthq/types/contract';
|
|
18
|
+
import { BatchFormat, EntityRuntimeKey, PathCommand } from '@flighthq/types/contract';
|
|
19
19
|
|
|
20
20
|
import { enableWgpuStrokePathTessellation } from './enableWgpuStrokePathTessellation';
|
|
21
21
|
import { defaultWgpuMorphShapeRenderer, defaultWgpuShapeRenderer, drawWgpuShape } from './wgpuShape';
|
|
@@ -42,12 +42,14 @@ beforeEach(() => {
|
|
|
42
42
|
|
|
43
43
|
beforeEach(() => {
|
|
44
44
|
setRaster2DSurfaceProvider({
|
|
45
|
+
[EntityRuntimeKey]: undefined,
|
|
45
46
|
createRaster2DSurface(width, height) {
|
|
46
47
|
const canvas = document.createElement('canvas');
|
|
47
48
|
canvas.width = width;
|
|
48
49
|
canvas.height = height;
|
|
49
50
|
const context = canvas.getContext('2d')!;
|
|
50
51
|
return {
|
|
52
|
+
[EntityRuntimeKey]: undefined,
|
|
51
53
|
get width() {
|
|
52
54
|
return canvas.width;
|
|
53
55
|
},
|
|
@@ -4,6 +4,7 @@ import { getWgpuRenderStateRuntime } from '@flighthq/render-wgpu/contract';
|
|
|
4
4
|
import { createWgpuRenderStateForTest, installWgpuMock } from '@flighthq/render-wgpu/contract';
|
|
5
5
|
import { resetRaster2DSurfaceProviderForTest, setRaster2DSurfaceProvider } from '@flighthq/render/contract';
|
|
6
6
|
import type { WgpuShapeRendererData } from '@flighthq/types/contract';
|
|
7
|
+
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
acquireWgpuShapeRasterSurface,
|
|
@@ -21,12 +22,14 @@ beforeAll(() => {
|
|
|
21
22
|
beforeEach(() => {
|
|
22
23
|
destroySurface.mockReset();
|
|
23
24
|
setRaster2DSurfaceProvider({
|
|
25
|
+
[EntityRuntimeKey]: undefined,
|
|
24
26
|
createRaster2DSurface(width, height) {
|
|
25
27
|
const canvas = document.createElement('canvas');
|
|
26
28
|
canvas.width = width;
|
|
27
29
|
canvas.height = height;
|
|
28
30
|
const context = canvas.getContext('2d')!;
|
|
29
31
|
return {
|
|
32
|
+
[EntityRuntimeKey]: undefined,
|
|
30
33
|
get width() {
|
|
31
34
|
return canvas.width;
|
|
32
35
|
},
|
|
@@ -6,7 +6,7 @@ import { resetRaster2DSurfaceProviderForTest, setRaster2DSurfaceProvider } from
|
|
|
6
6
|
import { createTextLabel } from '@flighthq/text/contract';
|
|
7
7
|
import * as textlayout from '@flighthq/textlayout/contract';
|
|
8
8
|
import type { Raster2DSurface, RenderProxy2D } from '@flighthq/types/contract';
|
|
9
|
-
import { BatchFormat } from '@flighthq/types/contract';
|
|
9
|
+
import { BatchFormat, EntityRuntimeKey } from '@flighthq/types/contract';
|
|
10
10
|
|
|
11
11
|
import { registerWgpuStandardMaterial } from './wgpuStandardMaterial';
|
|
12
12
|
import { defaultWgpuTextLabelRenderer, drawWgpuTextLabel } from './wgpuTextLabel';
|
|
@@ -43,6 +43,7 @@ function createTestRaster2DSurface(width: number, height: number): Raster2DSurfa
|
|
|
43
43
|
canvas.height = height;
|
|
44
44
|
const context = canvas.getContext('2d')!;
|
|
45
45
|
return {
|
|
46
|
+
[EntityRuntimeKey]: undefined,
|
|
46
47
|
get width() {
|
|
47
48
|
return canvas.width;
|
|
48
49
|
},
|
|
@@ -91,6 +92,7 @@ function installTestRaster2DSurfaceProvider(
|
|
|
91
92
|
destroyRaster2DSurface: (surface: Raster2DSurface) => void = () => {},
|
|
92
93
|
): void {
|
|
93
94
|
setRaster2DSurfaceProvider({
|
|
95
|
+
[EntityRuntimeKey]: undefined,
|
|
94
96
|
createRaster2DSurface(width, height) {
|
|
95
97
|
return createTestRaster2DSurface(width, height);
|
|
96
98
|
},
|