* Mark a region as dirty * 标记区域为脏
(x: number, y: number, width: number, height: number)
| 332 | * 标记区域为脏 |
| 333 | */ |
| 334 | private markDirty(x: number, y: number, width: number, height: number): void { |
| 335 | this._dirty = true; |
| 336 | |
| 337 | if (!this._dirtyRegion) { |
| 338 | this._dirtyRegion = { x, y, width, height }; |
| 339 | } else { |
| 340 | const r = this._dirtyRegion; |
| 341 | const newX = Math.min(r.x, x); |
| 342 | const newY = Math.min(r.y, y); |
| 343 | const newWidth = Math.max(r.x + r.width, x + width) - newX; |
| 344 | const newHeight = Math.max(r.y + r.height, y + height) - newY; |
| 345 | this._dirtyRegion = { x: newX, y: newY, width: newWidth, height: newHeight }; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | /** |
| 350 | * Upload texture to GPU |
no test coverage detected