qtfb: repaint only the dirty region in FBController::paint#64
Closed
icetingyu wants to merge 1 commit into
Closed
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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