You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Zooming over a projected raster stutters: mid-motion frames on the UI thread, single-threaded upscale and reprojection grid #1792
Zooming in and out over a projected raster stutters on the desktop app. It shows from about zoom 17, where the raster fills the view, and is worse on HiDPI screens.
To reproduce: load one swissALTI3D tile (swissalti3d_2026_2696-1261_0.5_2056_5728.tif) and zoom in and out between zoom 15 and 20. The tile is:
in EPSG:2056, so it is reprojected to Web Mercator;
16 MB, held in memory, so nothing is read while zooming.
The test machine runs GNOME on Wayland at 150 % scaling, with 20 cores. The app is main at f22d9bb, which includes #1775.
Why
#1775 moved the frame drawn once the map settles off the UI thread. While the map moves, the view still redraws a frame inline on the UI thread (crates/ui-egui/src/mapview.rs, the motion frames). It does so every 10 % of zoom (MOTION_STRETCH), and at once to fill a gap when zooming out (GAP_SPAN).
With this raster, each such frame blocks the window for two or three display frames.
Measured
rustgis_render::render of the tile alone, in a 1600 × 1000 logical view at zoom 18 to 20:
Display scale
Frame
Raster draw
Upscale to screen
Reprojection grid
Pass 1 + pass 2
1×
~20 ms
~18 ms
none
6.6 ms
~9 ms
1.5×
~45 ms
~40 ms
~24 ms
6.6 ms
~9 ms
2×
~60 ms
~56 ms
~41 ms
6.6 ms
~9 ms
Upscale. On a screen of 1.5× or more, raster::draw_with computes the raster at logical resolution, then scales it up with tiny-skia's draw_pixmap (bilinear), which runs on one thread. That step is half to two thirds of the frame. At 1× a plain multi-threaded copy (blend_over) is used instead.
Reprojection grid. The exact source positions (one every 8 px, about 25,000 LV95 transforms) are computed on one thread. Passes 1 and 2 already use every core.
Device resolution. Computing at device resolution instead isn't faster: 46 ms at 1.5× and 75 ms at 2×, because the single-threaded grid grows with it.
Plan
Scale the work image up on several threads (parallel helpers, the user's thread count), the same bilinear or nearest filter as now, so the output matches tiny-skia's to within rounding.
Compute the reprojection grid's rows on several threads, giving the same positions as one thread.
Item 3 is #1791 (draws a moving flat map's frames off the UI thread), so this issue now covers items 1 and 2: the multi-threaded upscale and reprojection grid. With #1791 they make the worker's frames for such a raster land in about a third of the time, and the settled frame and exports benefit too.
Activity
pick2510 commentedon Nov 11, 2026
I'm working on this: items 1 and 2 first (a draft pull request soon), then 3.
pick2510 commentedon Nov 11, 2026
Item 3 is #1791 (draws a moving flat map's frames off the UI thread), so this issue now covers items 1 and 2: the multi-threaded upscale and reprojection grid. With #1791 they make the worker's frames for such a raster land in about a third of the time, and the settled frame and exports benefit too.
perf(render): scale a raster up and reproject its grid on several thr…