mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 17:27:32 +00:00
2a7bf8528abdd45802a2ce98e411b2937b0cc8c6
The span-selector panel was rendered directly onto the spectrum canvas every frame via DrawSelf, doing ~30 TextWidth + ~11 TextOut Canvas calls. On Cocoa these text ops are very expensive (~10.6 ms/frame, ~30% of a core) and dominated DrawSpectrum. Render the panel once into a per-pixel-alpha cache bitmap and only composite it over the spectrum each frame; rebuild only when state changes (rate, hover, hidden, bounds). The cache is built with the two-background method (render over black and white, derive straight alpha + color) so layered semi-transparent button fills and antialiased text composite over the live spectrum exactly as before. Cuts the overlay phase from ~10.6 ms to ~0.2 ms per frame; DrawSpectrum drops ~13.8 ms -> ~2.7 ms. Mirrors the caching VfoOverlay already uses. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Languages
Pascal
96.3%
Python
3%
Shell
0.6%