mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Adds `CallbackTrait::needs_backdrop`, so an effect can transform what egui has already drawn rather than draw over it. Background blur behind a window or a panel is the motivating case. Nothing can sample the texture it is currently drawing into, so this needs the render pass interrupted and the half-drawn frame copied aside. The renderer does not own its pass, so the integration has to drive that: `render_from` draws until it reaches a callback that wants a backdrop and stops, and `capture_backdrop` copies the frame and lets the callback run its own passes over it. `render` still works as before for integrations that do not care; callbacks that asked for a backdrop just get a plain `paint`. The surface texture cannot be copied from on every platform, which is why `CaptureState` exists for screenshots. `Painter` now renders into that texture whenever a backdrop is needed too, and blits it onto the surface afterwards, so `copy_textures` is split into `copy_to_buffer` and `blit_to_surface`. `egui_kittest`'s wgpu renderer drives the same loop, so backdrop effects can be snapshot-tested. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
egui-wgpu
This crates provides bindings between egui and wgpu.
This was originally hosted at https://github.com/hasenbanck/egui_wgpu_backend