@next2d/renderer 3.2.1 → 3.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/renderer",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "Next2D Renderer Package",
5
5
  "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -24,9 +24,9 @@
24
24
  "url": "git+https://github.com/Next2D/Player.git"
25
25
  },
26
26
  "dependencies": {
27
- "@next2d/webgl": "3.2.1",
28
- "@next2d/webgpu": "3.2.1",
29
- "@next2d/cache": "3.2.1",
30
- "@next2d/texture-packer": "3.2.1"
27
+ "@next2d/webgl": "3.3.0",
28
+ "@next2d/webgpu": "3.3.0",
29
+ "@next2d/cache": "3.3.0",
30
+ "@next2d/texture-packer": "3.3.0"
31
31
  }
32
32
  }
@@ -16,8 +16,9 @@ export const execute = (remove_cache_keys) => {
16
16
  continue;
17
17
  }
18
18
  const cache = $cacheStore.getById(cacheKey);
19
- for (const node of cache.values()) {
20
- $context.removeNode(node);
19
+ for (const value of cache.values()) {
20
+ // Node / ITextureObject / IAttachmentObject を型判定して適切に解放(プリミティブはスキップ)
21
+ $context.releaseTextureCache(value);
21
22
  }
22
23
  $cacheStore.removeById(cacheKey);
23
24
  }
@@ -53,7 +53,12 @@ export const execute = (render_queue, index) => {
53
53
  // Bitmapなので、スケールなし
54
54
  const width = Math.ceil(Math.abs(xMax - xMin));
55
55
  const height = Math.ceil(Math.abs(yMax - yMin));
56
- // fixed logic
56
+ // ShapeClearBitmapBufferUseCase 等で Main 側のみ wipe された場合、
57
+ // Worker には旧 Node が残っているため、新規作成前に解放してアトラスリーク防止
58
+ const oldBitmapNode = $cacheStore.get(uniqueKey, `${cacheKey}`);
59
+ if (oldBitmapNode) {
60
+ $context.removeNode(oldBitmapNode);
61
+ }
57
62
  node = $context.createNode(width, height);
58
63
  $cacheStore.set(uniqueKey, `${cacheKey}`, node);
59
64
  // fixed logic
@@ -81,7 +86,12 @@ export const execute = (render_queue, index) => {
81
86
  else {
82
87
  const width = Math.ceil(Math.abs(xMax - xMin) * xScale);
83
88
  const height = Math.ceil(Math.abs(yMax - yMin) * yScale);
84
- // fixed logic
89
+ // ShapeClearBitmapBufferUseCase 等で Main 側のみ wipe された場合、
90
+ // Worker には旧 Node が残っているため、新規作成前に解放してアトラスリーク防止
91
+ const oldNode = $cacheStore.get(uniqueKey, `${cacheKey}`);
92
+ if (oldNode) {
93
+ $context.removeNode(oldNode);
94
+ }
85
95
  node = $context.createNode(width, height);
86
96
  $cacheStore.set(uniqueKey, `${cacheKey}`, node);
87
97
  // fixed logic
@@ -46,10 +46,17 @@ export const execute = (render_queue, index) => {
46
46
  const width = Math.ceil(Math.abs(xMax - xMin) * xScale);
47
47
  const height = Math.ceil(Math.abs(yMax - yMin) * yScale);
48
48
  const hasNode = Boolean(render_queue[index++]);
49
- node = hasNode
50
- ? $cacheStore.get(uniqueKey, `${cacheKey}`)
51
- : $context.createNode(width, height);
52
- if (!hasNode) {
49
+ if (hasNode) {
50
+ node = $cacheStore.get(uniqueKey, `${cacheKey}`);
51
+ }
52
+ else {
53
+ // TextFieldResetUseCase 等で Main 側のみ wipe された場合、
54
+ // Worker には旧 Node が残っているため、新規作成前に解放してアトラスリーク防止
55
+ const oldNode = $cacheStore.get(uniqueKey, `${cacheKey}`);
56
+ if (oldNode) {
57
+ $context.removeNode(oldNode);
58
+ }
59
+ node = $context.createNode(width, height);
53
60
  $cacheStore.set(uniqueKey, `${cacheKey}`, node);
54
61
  }
55
62
  const length = render_queue[index++];
@@ -37,10 +37,17 @@ export const execute = (render_queue, index, image_bitmaps) => {
37
37
  const width = Math.abs(xMax - xMin);
38
38
  const height = Math.abs(yMax - yMin);
39
39
  const hasNode = Boolean(render_queue[index++]);
40
- node = hasNode
41
- ? $cacheStore.get(uniqueKey, `${cacheKey}`)
42
- : $context.createNode(width, height);
43
- if (!hasNode) {
40
+ if (hasNode) {
41
+ node = $cacheStore.get(uniqueKey, `${cacheKey}`);
42
+ }
43
+ else {
44
+ // Main 側のみ wipe された race を考慮し、新規作成前に旧 Node を解放
45
+ // (Shape/TextField MISS パスと同じ防御策。通常は no-op)
46
+ const oldNode = $cacheStore.get(uniqueKey, `${cacheKey}`);
47
+ if (oldNode) {
48
+ $context.removeNode(oldNode);
49
+ }
50
+ node = $context.createNode(width, height);
44
51
  $cacheStore.set(uniqueKey, `${cacheKey}`, node);
45
52
  }
46
53
  if (image_bitmaps && image_bitmaps.length) {