Optimize phone CPU usage

This commit is contained in:
James Babcock committed 2026-09-27 23:16:41 -07:00
1 parent 449cb0bf73
commit 45d2ece0d2
19 files changed
+485 -103

No files matched your search

+7
View File
@@ -2515,6 +2515,13 @@ class DashboardController {
return;
}
const fingerprint = frameTimings.span(frameId, "fingerprint", () => planesFingerprint(planes));
// An identical repaint (e.g. every in-process window re-renders when the
// switcher brings it to the foreground) would flatten, encode and
// composite only to be deduped before sending.
if (display.isSurfaceCurrent(surfaceId, fingerprint)) {
frameTimings.finishFrame(frameId, "discarded: surface unchanged");
return;
}
const { image, draws } = frameTimings.span(frameId, "flatten", () => flattenPlanesWithDraws(planes));
const buffer = frameTimings.span(frameId, "to8bpp", () => image.to8bppBuffer());
const preparedDraws = frameTimings.span(frameId, "prepareFrameDraws", () => prepareFrameDraws(draws));