perf: Increase virtual zoom rendering FPS from 30 to 60.

This commit is contained in:
AEmotionStudio
2026-01-04 21:32:31 -08:00
parent 893c54d744
commit ca71d0c2ed
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -20,8 +20,8 @@ export class OffscreenRenderer {
private lastRenderHeight: number = 0;
private isCapturing: boolean = false;
// Virtual Zoom Throttling (30 FPS = ~33ms per frame)
private static readonly VIRTUAL_ZOOM_MIN_INTERVAL_MS = 33;
// Virtual Zoom Throttling (60 FPS = ~16ms per frame)
private static readonly VIRTUAL_ZOOM_MIN_INTERVAL_MS = 16;
private lastVirtualZoomTime: number = 0;
private cachedVirtualZoomResult: HTMLCanvasElement | null = null;
@@ -70,7 +70,7 @@ export class OffscreenRenderer {
this.cachedVirtualZoomResult = null; // Invalidate cache when switching modes
return this.renderDirectCapture(targetCanvas, renderSize, dpr);
} else {
// Virtual Zoom: Throttled to 30 FPS to prevent FPS counter inflation
// Virtual Zoom: Throttled to 60 FPS to prevent FPS counter inflation
const now = performance.now();
const elapsed = now - this.lastVirtualZoomTime;
+2 -2
View File
@@ -592,8 +592,8 @@ const _OffscreenRenderer = class _OffscreenRenderer {
return this.offscreenCanvas;
}
};
// Virtual Zoom Throttling (30 FPS = ~33ms per frame)
__publicField(_OffscreenRenderer, "VIRTUAL_ZOOM_MIN_INTERVAL_MS", 33);
// Virtual Zoom Throttling (60 FPS = ~16ms per frame)
__publicField(_OffscreenRenderer, "VIRTUAL_ZOOM_MIN_INTERVAL_MS", 16);
let OffscreenRenderer = _OffscreenRenderer;
export {
OffscreenRenderer
File diff suppressed because one or more lines are too long