Feature/blur backdrop - #956
Conversation
…ndow captureEnd() used to strip the bracketed content's queued RenderCommands out of the subwindow's render queue and replay them immediately, out of order, during build. That's fine at top level, but when BlurBackdrop is nested inside another floating window (as in the Blur Backdrop showcase tab), the enclosing window's own background fill is also a queued command - queued earlier but only actually drawn later, during Window.endRendering. Paint order became: bracketed content drawn early, then the enclosing background drawn late right over it - the checkerboard vanishing behind the window on every dirty frame (every tick of a slider drag), self-healing only once idle. Fix: leave the commands in the subwindow's normal queue instead of stripping/replaying them, so they draw exactly once, in their natural order, via the same endRendering pass as everything else. Also slider continuity/fractional radius tweaks in the demo, and a live-backend regression test (reads raw SDL_Renderer pixels directly, bypassing dvui.Picture, which redirects into its own offscreen target and can't see this ordering bug) that drives a real drag and asserts the checkerboard stays visible on every frame.
It reads pixels via SDL_RenderReadPixels, which the testing backend used in CI's -Dbackend=testing job doesn't support.
Its pixel readback uses the SDL3 SDL_RenderReadPixels signature, which differs from SDL2's (rect/pixels/pitch args vs surface return).
|
Sorry I am traveling right now, will get to this in a few days, thanks! |
|
I love this!
Looks great - merge when ready. Thank you! |
|
This is awesome, well done! |
thanks for the feedback! afaik yes, but deinit is still needed. actually its wired up false in the example and leaks.
i am not 100% sure if you could achieve something similar with Picture, but boundary crossing content was the issue. new api: ...
const backdrop = dvui.BlurBackdrop.get(@src());
...
backdrop.init(some_rect, .{backdrop.radius_px});
defer backdrop.deinit(); |
|
Excellent, I will chew on that new api and see if Can you move the new demo part into the "Applets" section? Then merge it. Thank you! |
adds backdrop blur to dvui.

i tested in in the web browser (the serve-web-app is great for that!), sdl3, raylib, sdl2
its worth to note that the blur in my testing looked different for sdl2 then the other backends.
sdl2 skews/compresses a quad's UV mapping rather than clamping the edge resulting in a visually different blur.
#923