Skip to content

qtfb: repaint only the dirty region in FBController::paint#64

Closed
icetingyu wants to merge 1 commit into
asivery:masterfrom
icetingyu:perf/qtfb-paint-dirty-region
Closed

qtfb: repaint only the dirty region in FBController::paint#64
icetingyu wants to merge 1 commit into
asivery:masterfrom
icetingyu:perf/qtfb-paint-dirty-region

Conversation

@icetingyu

Copy link
Copy Markdown

Complements #63.

FBController::paint() always converts and blits the entire client framebuffer, so every repaint costs a full-frame RGB565-to-texture conversion and upload regardless of how small the dirty area is. This PR blits only the painter's clip region — the scene graph clips the painter to the accumulated dirty rect — and falls back to the previous full blit whenever no clip is set (whole-item repaints, UPDATE_ALL, setActive).

Standalone this is behavior-neutral: today every partial update collapses to a whole-item repaint (the integer-division bug #63 fixes), so the clip is never set and the fallback path runs. Combined with #63, the per-update cost of streaming ink drops from O(full frame) to O(rect).

Tested on a reMarkable 2, firmware 3.28.0.162, together with a #63-equivalent fix: sustained handwriting in a windowed qtfb app goes from laggy full-screen refreshes to native-feeling partial updates.

🤖 Generated with Claude Code

paint() always converted and blitted the entire client framebuffer,
so every repaint cost a full-frame RGB565 conversion and texture
upload regardless of how small the dirty area was. Blit only the
painter's clip region (the scene graph clips it to the accumulated
dirty rect), falling back to the full blit when no clip is set.

On its own this is behavior-neutral; combined with asivery#63 (which keeps
partial update rects from collapsing to whole-item repaints) it drops
the per-update cost of streaming ink from O(full frame) to O(rect).
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.

1 participant