@next2d/core 3.17.0 → 3.18.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/core",
3
- "version": "3.17.0",
3
+ "version": "3.18.0",
4
4
  "description": "Next2D Core Package",
5
5
  "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -24,15 +24,15 @@
24
24
  "url": "git+https://github.com/Next2D/Player.git"
25
25
  },
26
26
  "dependencies": {
27
- "@next2d/core": "3.17.0",
28
- "@next2d/display": "3.17.0",
29
- "@next2d/events": "3.17.0",
30
- "@next2d/filters": "3.17.0",
31
- "@next2d/geom": "3.17.0",
32
- "@next2d/media": "3.17.0",
33
- "@next2d/net": "3.17.0",
34
- "@next2d/text": "3.17.0",
35
- "@next2d/ui": "3.17.0",
36
- "@next2d/render-queue": "3.17.0"
27
+ "@next2d/core": "3.18.0",
28
+ "@next2d/display": "3.18.0",
29
+ "@next2d/events": "3.18.0",
30
+ "@next2d/filters": "3.18.0",
31
+ "@next2d/geom": "3.18.0",
32
+ "@next2d/media": "3.18.0",
33
+ "@next2d/net": "3.18.0",
34
+ "@next2d/text": "3.18.0",
35
+ "@next2d/ui": "3.18.0",
36
+ "@next2d/render-queue": "3.18.0"
37
37
  }
38
38
  }
@@ -35,6 +35,23 @@ const $message = {
35
35
  const $options = [];
36
36
  let $limitRenderQueue = false;
37
37
  let $pendingRenders = 0;
38
+ /**
39
+ * @description レンダラーに処理中のまま預けておける描画の数の上限。
40
+ * 1 にすると、返事が届くまで次の描画を送れず、メインとレンダラーが順番待ちになる:
41
+ * メインが描画を送るまでの時間とレンダラーの 1 回の処理時間の合計が画面の更新 1 回分を
42
+ * 超えると、どちらも単独では間に合っていても 1 コマ抜ける。2 なら、レンダラーが前の描画を
43
+ * 処理している間にメインが次の描画を作って送れる。溜まり続けることはない (上限で止まる)。
44
+ * The maximum number of renders left with the renderer at a time. With 1, the next
45
+ * render cannot be sent until the reply arrives, which serializes the two threads: a
46
+ * frame is dropped whenever the main thread's time before sending plus the renderer's
47
+ * time for one render exceeds one display refresh, even though each fits on its own.
48
+ * With 2, the main thread can build and send the next render while the renderer works
49
+ * on the previous one. The backlog stays bounded by this limit.
50
+ *
51
+ * @type {number}
52
+ * @const
53
+ */
54
+ const $MAX_PENDING_RENDERS = 2;
38
55
  // 受け取りイベントを登録
39
56
  $rendererWorker.addEventListener("message", (event) => {
40
57
  if (event.data.message === "renderFlowControl") {
@@ -60,9 +77,9 @@ $rendererWorker.addEventListener("message", (event) => {
60
77
  * @protected
61
78
  */
62
79
  export const execute = () => {
63
- // Do not generate/consume cache changes while the renderer is busy.
80
+ // Do not generate/consume cache changes while the renderer has a backlog.
64
81
  // stage.changed remains set, so the next tick sends the latest display state.
65
- if ($limitRenderQueue && $pendingRenders) {
82
+ if ($limitRenderQueue && $pendingRenders >= $MAX_PENDING_RENDERS) {
66
83
  return;
67
84
  }
68
85
  renderQueue.offset = 0;