feat(app): OFX Interact viewer integration - overlay drawing and event forwarding
- Main-process interact instances for the selected OFX effect card (create on selection change, describe, destroy on deselect/close), coexisting with the render-worker plugin instances per the OFX multi-instance model. - Program viewer composites the interact's overlay: draw into a GL FBO via gl_bridge, read back, straight-alpha 'over' composite onto the displayed frame; cached and only re-rendered on frame/time/ viewport/instance change or plugin redraw requests. - Event forwarding: picture-area pointer maps through the contain-fit letterbox inverse to OFX pen coordinates (pen_motion/down/up); Keystroke to OFX key symbols (ASCII, navigation, F1-F35) for key_down/up; a 50ms idle pump; global shortcut consumption keeps precedence. - e2e with the real test plugin: lifecycle marker assertions, pen/key event records, and macOS GL overlay compositing verified (265 tests green incl. gpui_widgets viewer suite).
This commit is contained in:
@@ -318,8 +318,10 @@ fn interact_draw_renders_plugin_colours() {
|
||||
);
|
||||
|
||||
// 像素断言:矩形区域 (10..30)² 的 GL 像素 → 翻转后 frame y 33..53。
|
||||
// F32 RGBA 每像素 16 字节(紧凑行)。
|
||||
let stride = (w as usize) * 16;
|
||||
let px = |x: usize, y: usize| -> [f32; 4] {
|
||||
let p = &img.pixels()[y * (w as usize) * 4 + x * 4..y * (w as usize) * 4 + x * 4 + 4];
|
||||
let p = &img.pixels()[y * stride + x * 16..y * stride + x * 16 + 16];
|
||||
[
|
||||
f32::from_ne_bytes(p[0..4].try_into().unwrap()),
|
||||
f32::from_ne_bytes(p[4..8].try_into().unwrap()),
|
||||
|
||||
Reference in New Issue
Block a user