Files
crosspoint-reader-mod/chat-summaries/2026-02-12_23-00-summary.md
cottongin dfbc931c14 mod: Phase 1 - bring forward mod-exclusive files with ActivityManager migration
Brings ~55 mod-exclusive files to the upstream-based mod/master-resync branch:

Activities (migrated to new ActivityManager pattern):
- Clock/Time: SetTimeActivity, SetTimezoneOffsetActivity, NtpSyncActivity
- Dictionary: DictionaryDefinitionActivity, DictionarySuggestionsActivity,
  DictionaryWordSelectActivity, LookedUpWordsActivity
- Bookmark: EpubReaderBookmarkSelectionActivity
- Book management: BookManageMenuActivity, EndOfBookMenuActivity
- OPDS: OpdsServerListActivity, OpdsSettingsActivity
- Utility: DirectoryPickerActivity, NumericStepperActivity

Utilities (unchanged):
- BookManager, BookSettings, BookmarkStore, BootNtpSync
- Dictionary, LookupHistory, TimeSync, OpdsServerStore

Libraries: PlaceholderCover, TableData, ChapterXPathIndexer
Scripts: inject_mod_version, generate_book_icon, preview_placeholder_cover
Docs: KOReader sync XPath mapping

Migration changes:
- ActivityWithSubactivity -> Activity base class
- Callback constructors -> finish()/setResult() pattern
- enterNewActivity() -> startActivityForResult()
- Activity::RenderLock&& -> RenderLock&&

These files won't compile yet - they reference mod settings and I18n
strings that will be added in subsequent phases.

Made-with: Cursor
2026-03-07 15:10:00 -05:00

1.9 KiB

Implement Letterbox Edge Row Copy for MATCHED Mode

Task

Implement the "FrameBuffer Edge Row Copy" plan for the MATCHED letterbox fill mode. Instead of computing letterbox colors from sampled edge data, the new approach copies the cover's rendered edge row directly from the frameBuffer into the letterbox area after each drawBitmap call.

Changes Made

src/activities/boot_sleep/SleepActivity.cpp

  • Added #include <cstring> for memcpy usage.
  • Added copyEdgeRowsToLetterbox() helper (anonymous namespace): Copies physical columns (horizontal letterbox) or physical rows (vertical letterbox) in the frameBuffer. For horizontal letterbox, iterates per-bit across 480 physical rows. For vertical letterbox, uses memcpy of 100-byte physical rows.
  • Updated renderBitmapSleepScreen():
    • Added scaledWidth/scaledHeight computation matching drawBitmap's floor logic.
    • Added isMatched flag.
    • MATCHED mode now skips edge sampling entirely (sampleBitmapEdges / cache load).
    • After each drawBitmap call (BW, LSB, MSB passes), calls copyEdgeRowsToLetterbox for MATCHED mode.
  • Cleaned up dead code:
    • Removed the entire MATCHED case from drawLetterboxFill() (no longer called for MATCHED).
    • Removed grayToVal2bit helper (was only used by the removed MATCHED case).
    • Removed skipFillInGreyscale flag (no longer needed — the edge copy participates in all passes naturally).

Build

Successfully compiled with pio run (0 errors, 0 warnings relevant to changes).

Follow-up

  • Needs on-device testing to verify:
    1. The letterbox blends seamlessly with the cover edge (pixel-perfect 1:1 match).
    2. No scan coupling corruption (the scattered pixel distribution from dithering should cause less coupling than uniform blocks).
    3. If corruption is still unacceptable, the fallback is the previous flat-fill + greyscale-skip approach (revert this change).