Reduce timer-tick CPU load by removing per-tick ResizeSMeter and throttling AGC line updates

- Remove ResizeSMeter (Pango font measurement + multiple SetBounds) from 60 Hz timer tick;
  it is still called on actual resize events
- Throttle UpdateAGCLines WDSP API calls from 60 Hz to ~10 Hz (every 6 ticks)
- Optimize spectrum alpha-fix loop: write-only byte access instead of read-modify-write DWORD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 18:51:41 +03:00
co-authored by Claude Sonnet 4.6
parent 03693dc0f4
commit 1eecd974fc
2 changed files with 15 additions and 7 deletions
+6 -3
View File
@@ -696,7 +696,7 @@ procedure TSpectrumView.DrawSpectrum;
var
C, GC: TCanvas;
i, Yp, W, H, GX: Integer;
AlphaRow: PCardinal;
AlphaPtr: PByte;
DBmin, DBmax, dB: Double;
VfoX, X1, X2: Integer;
TXVfoX, TXX1, TXX2: Integer;
@@ -907,9 +907,12 @@ begin
FSpectrumBitmap.BeginUpdate(False);
for i := 0 to H - 1 do
begin
AlphaRow := PCardinal(FSpectrumBitmap.ScanLine[i]);
AlphaPtr := PByte(FSpectrumBitmap.ScanLine[i]) + 3;
for Yp := 0 to W - 1 do
AlphaRow[Yp] := AlphaRow[Yp] or $FF000000;
begin
AlphaPtr^ := $FF;
Inc(AlphaPtr, 4);
end;
end;
FSpectrumBitmap.EndUpdate(False);
end;