Stop repainting the playing card every frame, sharpen the drop on phones

--energy is now set only on the art and the glow, and only when it changes,
so the card is no longer restyled every frame. The halo pulses through
transform and opacity, without forcing layout or paint. The card background
is blurred and darkened once on a small canvas, so the full-screen CSS blur is
gone. The action rings no longer use backdrop-filter, and neither do the mode
tabs and the up-next pill on phones. The chrome layer reads the layout only
after a resize or a font load. The drop's fragment shader skips the icon, the
ring and the frost while none of them shows.

That saves enough to render the drop at up to 1.5 canvas px per CSS px on
phones, up from 1. ?debug=drop shows fps, the worst frame and chrome draws per
second, refreshed once a second.
This commit is contained in:
nvrl committed 2026-11-02 00:29:08 +01:00
1 parent 3de51b2517
commit b29062db3e
6 files changed
+187 -43

No files matched your search

+3 -2
View File
@@ -307,12 +307,13 @@ export class LiquidBlob {
return this.morph < 1 || moving || spinning || showing || this.pointer[3] > 0.01 || this.pointerGoal[3] > 0;
}
/// Canvas pixels per CSS pixel at full quality. Phones stay at 1 for the battery.
/// Canvas pixels per CSS pixel at full quality. Phones stay at 1.5 at most, for
/// the battery; the quality steps take that down on phones that cannot keep up.
/// Low-density desktop screens render at 2 and scale down, which smooths the
/// edges and the icon that would otherwise fall on too few pixels.
private density(): number {
const dpr = devicePixelRatio || 1;
if (this.touch) return Math.min(dpr, 1);
if (this.touch) return Math.min(dpr, 1.5);
return dpr < 1.5 ? 2 : 1.5;
}