Improve frame dropping under backpressure
This commit is contained in:
@@ -657,7 +657,7 @@ function trimPendingFrameQueue() {
|
||||
const overflow = state.pendingFrames.length - maxQueuedFrames;
|
||||
|
||||
if (overflow > 0) {
|
||||
state.pendingFrames.splice(maxQueuedFrames, overflow);
|
||||
state.pendingFrames.splice(0, overflow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ function trimFrameQueue() {
|
||||
return;
|
||||
}
|
||||
|
||||
const removed = state.frames.splice(maxQueuedFrames, overflow);
|
||||
const removed = state.frames.splice(0, overflow);
|
||||
|
||||
for (const frame of removed) {
|
||||
releaseImage(frame.bitmap);
|
||||
|
||||
Reference in New Issue
Block a user