aethersdr / aethersdr/AetherSDR

PSK Reporter city lights: pre-scale the flat-map image off the main thread

Open
#5,486 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement GUI maintainer-review
Dominant language
C++
Stars
221
Forks
117
Avg merge
2d 7h
Merged PRs (30d)
299

Description

Summary

Follow-up to #5479 (closes #5478). On the flat map, CityLightsItem::projPaint draws the full rendered city-lights image (up to 4096×4096, Format_ARGB32_Premultiplied) into the viewport with SmoothPixmapTransform on every repaint. The twilight/gamma/warmth render already runs on a worker, but this per-frame resample happens on the main thread.

Observed

While reviewing #5479 under software GL (xvfb / llvmpipe), enabling the layer produced two MainThreadWatchdog stalls, ~1.4 s and ~0.9 s, coinciding with the first two presentations of the image (initial load, then the twilight re-render). Not yet measured on a hardware GPU; it may be far cheaper there, but the work is still proportional to the source image size rather than the viewport.

Proposed change

After each CityLightsSource render completes, produce a viewport-resolution copy on the same QtConcurrent worker (scale to the item's current on-screen size for the visible world copies, respecting the device pixel ratio), and have CityLightsItem blit that instead of resampling the full image. Re-scale on zoom changes only, with the same debounce the source already uses for view changes. The full-resolution image stays as the source so the globe (which samples the original on the GPU) is unaffected.

Acceptance

  • No watchdog stall when enabling the layer or when the twilight re-render lands, on both software GL and a hardware GPU.
  • cityLightsFlatWrapAndOpacity in weather_radar_loading_test still passes (world wrapping and opacity unchanged).
  • No visible change in output at the same zoom.

Related, not in scope here

Two other main-thread costs on the map worth their own issues if they show up in profiling: marker/path batch construction for large PSK Reporter result sets, and base-map tile decoding in QGeoView on reply arrival.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing CityLightsItem::projPaint and the CityLightsSource render completion path, including the existing QtConcurrent worker and view-change debounce. Check how the current on-screen size and device pixel ratio are available, then run cityLightsFlatWrapAndOpacity in weather_radar_loading_test. Done means the flat map uses a worker-produced viewport-resolution image, zoom changes trigger rescaling, wrapping and opacity remain unchanged, and the watchdog stalls are absent on software and hardware GPU paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.