# Port PR #1055: Byte-level framebuffer writes **Date:** 2026-02-21 **Task:** Port upstream PR #1055 (jpirnay) into the mod, including coderabbit review nitpick. ## Changes made ### `lib/GfxRenderer/GfxRenderer.h` - Added two private method declarations: `fillPhysicalHSpanByte` (patterned byte-level span writer) and `fillPhysicalHSpan` (solid-fill wrapper). ### `lib/GfxRenderer/GfxRenderer.cpp` - Added `#include ` for `memset`. - Implemented `fillPhysicalHSpanByte`: bounds-clamped byte-level span writer with MSB-first bit packing, partial-byte masking at edges, and `memset` for aligned middle. - Implemented `fillPhysicalHSpan`: thin wrapper mapping `state` bool to `0x00`/`0xFF` pattern byte. - **`drawLine`**: Replaced per-pixel loops for axis-aligned lines with orientation-aware `fillPhysicalHSpan` calls (vertical lines in Portrait, horizontal lines in Landscape). - **`fillRect`**: Replaced per-row `drawLine` loop with orientation-specific byte-level fast paths for all 4 orientations. - **`fillRectDither`**: Replaced per-pixel `drawPixelDither` loops for DarkGray/LightGray with orientation-aware `fillPhysicalHSpanByte` using pre-computed byte patterns. - **`fillPolygon`** (coderabbit nitpick): Added `fillPhysicalHSpan` fast path for Landscape orientations in the scanline inner loop. ### `mod/prs/MERGED.md` - Appended PR #1055 entry with full documentation. ## Differences from upstream - `fillPolygon` landscape optimization (from coderabbit review nitpick) was applied as a mod enhancement. ## Follow-up items - None. Build verified successful.