Skip to content

fix(windows): honor dirty regions when presenting software canvas frames - #243

Open
oshtz wants to merge 1 commit into
vercel-labs:mainfrom
oshtz:fix/windows-incremental-pixel-present
Open

fix(windows): honor dirty regions when presenting software canvas frames#243
oshtz wants to merge 1 commit into
vercel-labs:mainfrom
oshtz:fix/windows-incremental-pixel-present

Conversation

@oshtz

@oshtz oshtz commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • retain the Windows reference-render surface between compatible software-canvas presents
  • round and clamp dirty bounds outward, then rasterize and convert only the damaged pixels after the first full frame
  • invalidate and blit only the dirty paint band while keeping the retained DIB at a stable origin
  • add Windows mapping and reference-raster regression coverage

Frame-budget impact

Before this change, every update converted and invalidated the entire surface. After the initial full frame, work scales with the damaged rectangle: on the issue's 718x759 reproduction, a representative 718x64 repaint band processes 45,952 pixels instead of 544,962, a 91.6% reduction in conversion work for that update.

Testing

  • zig build test-canvas
  • zig build test-desktop-platform: 182 passed, 1 skipped, 6 existing failures; clean main reports 181 passed, 1 skipped, the same 6 failures
  • scripts/gate.sh fast origin/main (the broad Windows checkout remains red only in failures reproduced on clean main and local example dependency/symlink setup)

Fixes #236

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

@oshtz is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows gpu_surface presentation is CPU-only and misses the frame budget

1 participant