@next2d/cache 3.15.1 → 3.17.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/cache",
3
- "version": "3.15.1",
3
+ "version": "3.17.0",
4
4
  "description": "Next2D Cache Package",
5
5
  "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -14,10 +14,11 @@ export const execute = (pool, object) => {
14
14
  }
15
15
  if ("canvas" in object) {
16
16
  const canvas = object.canvas;
17
- const width = canvas.width;
18
- const height = canvas.height;
19
- object.clearRect(0, 0, width + 1, height + 1);
20
17
  // canvas reset
18
+ // 大きさを設定するとキャンバスの内容と描画状態は初期化されるので、先に clearRect で
19
+ // 全面を消す必要は無い (消すと、捨てる直前のキャンバス全体をもう 1 度書き換えることになる)。
20
+ // Setting the size resets the bitmap and the drawing state, so clearing the whole
21
+ // canvas first is not needed (it would rewrite the entire canvas right before discarding it).
21
22
  canvas.width = canvas.height = 1;
22
23
  // pool
23
24
  pool.push(canvas);
package/src/CacheStore.js CHANGED
@@ -23,122 +23,6 @@ export class CacheStore {
23
23
  * @constructor
24
24
  */
25
25
  constructor() {
26
- /**
27
- * @description キャッシュプール
28
- * Cache pool
29
- *
30
- * @type {HTMLCanvasElement[]}
31
- * @private
32
- */
33
- Object.defineProperty(this, "_$pool", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: void 0
38
- });
39
- /**
40
- * @description キャッシュストア
41
- * Cache store
42
- *
43
- * @type {Map<string, any>}
44
- * @private
45
- */
46
- Object.defineProperty(this, "_$store", {
47
- enumerable: true,
48
- configurable: true,
49
- writable: true,
50
- value: void 0
51
- });
52
- /**
53
- * @description キャッシュトラッシュ
54
- * Cache trash
55
- *
56
- * @type {Map<string, any>}
57
- * @private
58
- */
59
- Object.defineProperty(this, "_$trash", {
60
- enumerable: true,
61
- configurable: true,
62
- writable: true,
63
- value: void 0
64
- });
65
- /**
66
- * @description キャッシュ削除用のタイマーID
67
- * Timer ID for cache deletion
68
- *
69
- * @type {number | null}
70
- * @public
71
- */
72
- Object.defineProperty(this, "$timerId", {
73
- enumerable: true,
74
- configurable: true,
75
- writable: true,
76
- value: void 0
77
- });
78
- /**
79
- * @description キャッシュタイマーの削除フラグ
80
- * Deletion flag of cache timer
81
- *
82
- * @type {boolean}
83
- * @default false
84
- * @public
85
- */
86
- Object.defineProperty(this, "$removeCache", {
87
- enumerable: true,
88
- configurable: true,
89
- writable: true,
90
- value: void 0
91
- });
92
- /**
93
- * @description キャッシュ削除用のIDリスト
94
- * ID list for cache deletion
95
- *
96
- * @type {number[]}
97
- * @public
98
- */
99
- Object.defineProperty(this, "$removeIds", {
100
- enumerable: true,
101
- configurable: true,
102
- writable: true,
103
- value: void 0
104
- });
105
- /**
106
- * @description キャッシュストアの最大エントリ数(LRU)。0は無制限(デフォルト・従来挙動)。
107
- * 上限はメインスレッド側でのみ設定し、evictしたIDは$removeIds経由で
108
- * worker側のGPUリソース(アトラスノード等)も解放される。
109
- * Maximum number of cache entries (LRU). 0 means unlimited
110
- * (default, legacy behavior). Set only on the main thread;
111
- * evicted IDs are propagated to the worker via $removeIds so
112
- * GPU resources (atlas nodes etc.) are released as well.
113
- *
114
- * @type {number}
115
- * @default 0
116
- * @public
117
- */
118
- Object.defineProperty(this, "$maxStoreSize", {
119
- enumerable: true,
120
- configurable: true,
121
- writable: true,
122
- value: void 0
123
- });
124
- /**
125
- * @description エントリ数がLRU上限($maxStoreSize)を超えているかどうか。
126
- * 毎フレーム参照されるため、関数を介さず直接参照する。
127
- * trueのとき、描画情報をworkerに送ったあとで evictOverLimit() を呼ぶ。
128
- * Whether the number of entries exceeds the LRU limit ($maxStoreSize).
129
- * Read directly (not through a function) because it is checked every frame.
130
- * When true, call evictOverLimit() after posting the render queue.
131
- *
132
- * @type {boolean}
133
- * @default false
134
- * @public
135
- */
136
- Object.defineProperty(this, "$overLimit", {
137
- enumerable: true,
138
- configurable: true,
139
- writable: true,
140
- value: void 0
141
- });
142
26
  this._$pool = [];
143
27
  this._$store = new Map();
144
28
  this._$trash = new Map();