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
2.7 KiB
Letterbox Fill Redesign
Date: 2026-02-13 Task: Strip out the 5-mode letterbox edge fill system and replace with a simplified 3-mode design
Changes Made
Problem
The existing letterbox fill feature had 5 modes (None, Solid, Blended, Gradient, Matched) with ~300 lines of complex code including per-pixel edge arrays, malloc'd buffers, binary edge caching, framebuffer-level column/row copying, and a gradient direction sub-setting. Several modes introduced visual corruption that couldn't be resolved.
New Design
Simplified to 3 modes:
- None -- no fill
- Solid -- computes dominant edge color, snaps to nearest of 4 e-ink levels (black/dark gray/light gray/white), fills uniformly
- Blended -- computes dominant edge color, fills with exact gray value using noise dithering for smooth approximation
Files Changed
-
src/CrossPointSettings.h-- RemovedLETTERBOX_GRADIENT,LETTERBOX_MATCHEDenum values; removedSLEEP_SCREEN_GRADIENT_DIRenum andsleepScreenGradientDirmember; changed default toLETTERBOX_NONE -
src/SettingsList.h-- Trimmed Letterbox Fill options to{None, Solid, Blended}; removed Gradient Direction setting entry -
src/CrossPointSettings.cpp-- RemovedsleepScreenGradientDirfrom write path; added dummy read for backward compatibility with old settings files; decrementedSETTINGS_COUNTfrom 32 to 31 -
src/activities/boot_sleep/SleepActivity.cpp-- Major rewrite:- Removed:
LetterboxGradientDatastruct,loadEdgeCache()/saveEdgeCache(),sampleBitmapEdges(),copyEdgeRowsToLetterbox(), olddrawLetterboxFill() - Added:
LetterboxFillDatastruct (2 bytes vs arrays),snapToEinkLevel(),computeEdgeAverages()(running sums only, no malloc), simplifieddrawLetterboxFill() - Cleaned
renderBitmapSleepScreen(): removed matched/gradient logic, edge cache paths, unusedscaledWidth/scaledHeight - Cleaned
renderCoverSleepScreen(): removed edge cache path derivation - Removed unused includes (
<Serialization.h>,<cstring>), added<cmath>
- Removed:
-
src/activities/boot_sleep/SleepActivity.h-- RemovededgeCachePathparameter fromrenderBitmapSleepScreen()signature; removed unused<string>include
Backward Compatibility
- Enum values 0/1/2 (None/Solid/Blended) unchanged -- existing settings preserved
- Old Gradient (3) or Matched (4) values rejected by
readAndValidate, falling back to default (None) - Old
sleepScreenGradientDirbyte consumed via dummy read during settings load - Orphaned
_edges.bincache files on SD cards are harmless
Follow-up Items
- Test all 3 fill modes on device with various cover aspect ratios
- Consider cleaning up orphaned
_edges.binfiles (optional, low priority)