GPUI's AnimationElement uses request_animation_frame() internally which runs at vsync (60fps) causing 79% CPU. Fragment shaders not exposed through GPUI's Scene API (paint_quad only accepts static color, no time uniform). Reverted to BlinkState timer pattern (3% CPU, 2 renders/sec). This is the same approach Zed uses for cursor blink. Tested approaches and results: - AnimationElement + pulsating_between: 79% CPU (vsync loop) - BlinkState + timer(500ms) + cx.notify(): 3% CPU (correct) - Custom Element + paint_quad: no shader access - CSS animation (Blitz): 30% CPU (full repaint loop) |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.lock | ||
| Cargo.toml | ||