mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
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:
+6
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user