Skip to content

Faster TFTColor processing#10814

Merged
jp-bennett merged 1 commit into
developfrom
faster-color
Jun 30, 2026
Merged

Faster TFTColor processing#10814
jp-bennett merged 1 commit into
developfrom
faster-color

Conversation

@jp-bennett

@jp-bennett jp-bennett commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

On a large screen, the color region resolution slows full frame draws down considerably. Used Claude to put together a simple approach to speed this up. It's two basic approaches. First, draw the whole screen with the default colors, then for each row see which color regions could possibly be active, and only process those.

Summary by CodeRabbit

  • New Features
    • Improved color rendering performance for TFT displays by narrowing color checks to only the regions that affect the current scan line.
    • Full-screen redraws now handle default colors more efficiently before applying any overlapping color overlays.
  • Bug Fixes
    • Updated partial row updates to use the same row-aware color resolution as full redraws, helping keep colored elements consistent during refreshes.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@github-actions github-actions Bot added needs-review Needs human review enhancement New feature or request labels Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f23e100f-2ab2-40cf-898f-2b690c6b9b96

📥 Commits

Reviewing files that changed from the base of the PR and between 8345c2b and 062ce8a.

📒 Files selected for processing (3)
  • src/graphics/TFTColorRegions.cpp
  • src/graphics/TFTColorRegions.h
  • src/graphics/TFTDisplay.cpp

📝 Walkthrough

Walkthrough

Adds a per-scanline culling mechanism for TFT color regions. A new beginTFTColorRow(y) function populates tftColorRowRegions/tftColorRowCount with indices of regions whose vertical span contains y. A new inline resolveTFTColorPixelRow uses that cached list. Both the full-frame repaint and span-update paths in TFTDisplay::display() are updated to call these row-scoped APIs.

Changes

TFT Per-row Color Region Culling

Layer / File(s) Summary
Row-scoped culling state and API
src/graphics/TFTColorRegions.cpp, src/graphics/TFTColorRegions.h
Defines tftColorRowRegions[] and tftColorRowCount globals; implements beginTFTColorRow(y) to populate active region indices; declares externs and inline resolveTFTColorPixelRow(x, isset, ...) in the header.
TFTDisplay rendering integration
src/graphics/TFTDisplay.cpp
Full-frame repaint path switches from per-pixel resolveTFTColorPixel to a two-phase prefill + region overprint loop; span update path calls beginTFTColorRow(y) once per row and uses resolveTFTColorPixelRow instead of resolveTFTColorPixel.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop along each scanline row,
only regions where colors glow!
We cull the list before we start,
painting pixels — what an art.
No wasted checks from top to toe~

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description states the goal and approach, but omits the required template sections and testing attestations. Replace the template text with the required PR format, including the attestations checklist and any relevant testing/device notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and clearly summarizes the main performance-focused TFT color processing change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@jp-bennett jp-bennett added baseui Issues directly related to BaseUI cleanup Code cleanup or refactor labels Jun 29, 2026
@jp-bennett jp-bennett merged commit 21dbe21 into develop Jun 30, 2026
97 of 98 checks passed
@jp-bennett jp-bennett deleted the faster-color branch June 30, 2026 02:50
@github-actions

Copy link
Copy Markdown
Contributor

Firmware Size Report

22 targets | vs develop: 22 increased, net +11,336 (+11.1 KB)

Target Size vs develop
heltec-vision-master-e213-inkhud 2,230,240 📈 +2,880 (+2.8 KB)
t-deck-tft 3,811,376 📈 +704
station-g3 2,266,848 📈 +496
rak11200 1,861,088 📈 +480
station-g2 2,266,832 📈 +480
Show 17 more target(s)
Target Size vs develop
heltec-v3 2,264,544 📈 +464
heltec-v4 2,277,760 📈 +464
rak3312 2,272,704 📈 +464
heltec-ht62-esp32c3-sx1262 2,135,440 📈 +448
seeed-xiao-s3 2,276,592 📈 +448
tlora-c6 2,368,752 📈 +448
t-eth-elite 2,491,920 📈 +432
elecrow-adv-35-tft 3,417,040 📈 +416
pico2w 1,220,932 📈 +416
picow 1,245,240 📈 +360
seeed_xiao_rp2350 768,296 📈 +360
pico2 770,128 📈 +352
pico 783,016 📈 +328
rak11310 805,752 📈 +328
seeed_xiao_rp2040 781,232 📈 +328
wio-e5 238,756 📈 +128
rak3172 186,408 📈 +112

Updated for fe195de

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

Labels

baseui Issues directly related to BaseUI cleanup Code cleanup or refactor enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant