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
1.9 KiB
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>formemcpyusage. - 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, usesmemcpyof 100-byte physical rows. - Updated
renderBitmapSleepScreen():- Added
scaledWidth/scaledHeightcomputation matchingdrawBitmap's floor logic. - Added
isMatchedflag. - MATCHED mode now skips edge sampling entirely (
sampleBitmapEdges/ cache load). - After each
drawBitmapcall (BW, LSB, MSB passes), callscopyEdgeRowsToLetterboxfor MATCHED mode.
- Added
- Cleaned up dead code:
- Removed the entire MATCHED case from
drawLetterboxFill()(no longer called for MATCHED). - Removed
grayToVal2bithelper (was only used by the removed MATCHED case). - Removed
skipFillInGreyscaleflag (no longer needed — the edge copy participates in all passes naturally).
- Removed the entire MATCHED case from
Build
Successfully compiled with pio run (0 errors, 0 warnings relevant to changes).
Follow-up
- Needs on-device testing to verify:
- The letterbox blends seamlessly with the cover edge (pixel-perfect 1:1 match).
- No scan coupling corruption (the scattered pixel distribution from dithering should cause less coupling than uniform blocks).
- If corruption is still unacceptable, the fallback is the previous flat-fill + greyscale-skip approach (revert this change).