perf: Increase virtual zoom rendering FPS from 30 to 60.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user