forked from Blendman974/faceclaw
Performance optimizations
This commit is contained in:
1 parent
e49c699062
commit
f6035ea9ec
18 files changed
+715
-158
No files matched your search
@@ -176,6 +176,9 @@ global.onmessage = (event: { data: WorkerAppMessage }) => {
|
||||
}
|
||||
window.focused = message.focused;
|
||||
inferForeground(message.focused);
|
||||
// Marks the main-thread -> worker hop, which is otherwise an
|
||||
// unexplained gap inside the shell's handle-input span.
|
||||
frameTimings.logFrame(message.frameId, `input received in ${message.windowId} worker`);
|
||||
handleInput(window, message.event as DashboardInputEvent, message.frameId);
|
||||
break;
|
||||
case "text-input":
|
||||
@@ -595,7 +598,7 @@ function renderAndSubmit(win: RoamWindow, inputFrameId: number): void {
|
||||
return;
|
||||
}
|
||||
const { image, draws } = frameTimings.span(frameId, "flatten", () => flattenPlanesWithDraws(planes));
|
||||
const buffer = image.to8bppBuffer();
|
||||
const buffer = frameTimings.span(frameId, "to8bpp", () => image.to8bppBuffer());
|
||||
communicator.submitSurfaceFrame(
|
||||
buffer.buffer,
|
||||
win.surfaceId,
|
||||
@@ -606,7 +609,7 @@ function renderAndSubmit(win: RoamWindow, inputFrameId: number): void {
|
||||
fingerprint,
|
||||
paintMs,
|
||||
frameId,
|
||||
prepareFrameDraws(draws),
|
||||
frameTimings.span(frameId, "prepareFrameDraws", () => prepareFrameDraws(draws)),
|
||||
);
|
||||
win.lastSubmittedFingerprint = fingerprint;
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user