@next2d/renderer 3.17.1 → 3.19.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.17.1",
3
+ "version": "3.19.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.17.1",
28
- "@next2d/webgpu": "3.17.1",
29
- "@next2d/cache": "3.17.1",
30
- "@next2d/texture-packer": "3.17.1"
27
+ "@next2d/webgl": "3.19.0",
28
+ "@next2d/webgpu": "3.19.0",
29
+ "@next2d/cache": "3.19.0",
30
+ "@next2d/texture-packer": "3.19.0"
31
31
  }
32
32
  }
@@ -85,8 +85,23 @@ const BITMAP_STROKE = 14;
85
85
  * @protected
86
86
  */
87
87
  export const execute = (commands, is_clip = false) => {
88
+ // 実行環境が経路の実装を提供していれば (WebGL のみ)、経路の命令の並びをまとめて渡す
89
+ let pathCommands = "pathCommands" in $context;
88
90
  let index = 0;
89
91
  while (commands.length > index) {
92
+ if (pathCommands) {
93
+ const code = commands[index];
94
+ if (code === MOVE_TO || code === LINE_TO || code === CURVE_TO
95
+ || code === CUBIC || code === ARC || code === CLOSE_PATH) {
96
+ const next = $context.pathCommands(commands, index);
97
+ if (next > index) {
98
+ index = next;
99
+ continue;
100
+ }
101
+ // この図形では使えない: 以降は 1 つずつ処理する
102
+ pathCommands = false;
103
+ }
104
+ }
90
105
  switch (commands[index++]) {
91
106
  case BEGIN_PATH:
92
107
  $context.beginPath();
@@ -97,7 +97,9 @@ export const execute = (render_queue, index) => {
97
97
  }
98
98
  $context.endNodeRendering();
99
99
  if (currentAttachment) {
100
- $context.bind(currentAttachment);
100
+ // 元の描画先へ戻す。GL の切り替えは、次に GL で描く時点まで保留される
101
+ // (未キャッシュの描画が続く間は、アトラスに切り替えたままになる)
102
+ $context.deferBind(currentAttachment);
101
103
  }
102
104
  }
103
105
  else {
@@ -134,7 +136,9 @@ export const execute = (render_queue, index) => {
134
136
  // 描画終了
135
137
  $context.endNodeRendering();
136
138
  if (currentAttachment) {
137
- $context.bind(currentAttachment);
139
+ // 元の描画先へ戻す。GL の切り替えは、次に GL で描く時点まで保留される
140
+ // (未キャッシュの描画が続く間は、アトラスに切り替えたままになる)
141
+ $context.deferBind(currentAttachment);
138
142
  }
139
143
  }
140
144
  index += isPackedPixels ? Math.ceil(length / 4) : length;
@@ -130,7 +130,9 @@ export const execute = (render_queue, index) => {
130
130
  $context.drawElement(node, canvas);
131
131
  $context.endNodeRendering();
132
132
  if (currentAttachment) {
133
- $context.bind(currentAttachment);
133
+ // 元の描画先へ戻す。GL の切り替えは、次に GL で描く時点まで保留される
134
+ // (未キャッシュの描画が続く間は、アトラスに切り替えたままになる)
135
+ $context.deferBind(currentAttachment);
134
136
  }
135
137
  }
136
138
  }
@@ -66,7 +66,9 @@ export const execute = (render_queue, index, image_bitmaps) => {
66
66
  $context.drawElement(node, imageBitmap, true);
67
67
  $context.endNodeRendering();
68
68
  if (currentAttachment) {
69
- $context.bind(currentAttachment);
69
+ // 元の描画先へ戻す。GL の切り替えは、次に GL で描く時点まで保留される
70
+ // (未キャッシュの描画が続く間は、アトラスに切り替えたままになる)
71
+ $context.deferBind(currentAttachment);
70
72
  }
71
73
  }
72
74
  }