Retro CRT: scanlines as one solid path, no vignette
The full-screen repeating gradient and radial vignette doubled CPU raster time per frame in the browser bench; solid non-AA bands cost about nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -55,15 +55,22 @@ device in light mode still gets a light page.
|
||||
blur in the text draw, not a layer filter.
|
||||
- Screen (`AppDesignTokens.screen`, `ScreenPattern`): scanlines every 3
|
||||
device pixels (a 1-device-pixel band of 16 % black; snapped to device
|
||||
pixels so they never moiré) and a vignette fading the corners to 28 %
|
||||
black. `DesignScreenOverlay` (in the `MaterialApp.builder` of the app, the
|
||||
connect flow and detached windows) paints it with one `CustomPaint` in its
|
||||
own `RepaintBoundary` above everything (menus and dialogs included),
|
||||
`IgnorePointer`, no semantics: two gradient-filled rectangles, painted
|
||||
once, repainted only on a resize, pixel-ratio or design change. No
|
||||
saveLayer, no filter, no animation (so nothing for reduced motion to stop).
|
||||
The app stays the Stack's first child, so a design switch does not remount
|
||||
it.
|
||||
pixels so they never moiré). `DesignScreenOverlay` (in the
|
||||
`MaterialApp.builder` of the app, the connect flow and detached windows)
|
||||
paints it with one `CustomPaint` in its own `RepaintBoundary` above
|
||||
everything (menus and dialogs included), `IgnorePointer`, no semantics:
|
||||
one solid, non-anti-aliased path of thin rectangles, recorded once and
|
||||
re-recorded only on a resize, pixel-ratio or design change. No saveLayer,
|
||||
no shader, no filter, no animation (so nothing for reduced motion to
|
||||
stop). The app stays the Stack's first child, so a design switch does not
|
||||
remount it.
|
||||
- No vignette. The first version drew the scanlines as a full-screen
|
||||
repeating gradient plus a full-screen radial vignette; the browser bench
|
||||
showed those two shaded fills, replayed every frame, more than doubled the
|
||||
CPU raster time of scrolling (an experiment build with the overlay but no
|
||||
glow: 77 ms vs Terminal's 33 ms raster per frame; with the glow but no
|
||||
overlay: 30 ms, i.e. the glow is about free). Solid bands fixed it; the
|
||||
vignette was optional and is dropped.
|
||||
|
||||
## Tokens added to `AppDesignTokens` (defaults keep every other design)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user