perf(audio,hid): 减少 PCM 复制和鼠标热路径分配与轮询

This commit is contained in:
mofeng-git
2026-10-01 22:55:57 +08:00
parent 3b8a4a6f34
commit 9a1f4ff4b5
7 changed files with 270 additions and 47 deletions

View File

@@ -871,7 +871,7 @@ impl HidBackend for OtgBackend {
let extent = self.screen_resolution.read().unwrap_or((1920, 1080));
let (buttons, reports) = state.plan(event, buttons, extent);
self.mouse_buttons.store(buttons, Ordering::Relaxed);
for report in reports {
for report in reports.iter().copied() {
match report {
MouseReport::Absolute { buttons, x, y } => {
self.send_mouse_report_absolute(buttons, x, y, 0)?