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
Port Upstream PR #978: Improve Font Drawing Performance
Date: 2026-02-19
Branch: mod/more-upstream-patches-for-1.1.0
Commit: 3a06418
Task
Port upstream PR #978 (perf: Improve font drawing performance) which optimizes glyph rendering by 15-23% on device.
Changes Made
Cherry-picked from upstream (commit 07d715e)
lib/GfxRenderer/GfxRenderer.cpp: IntroducedTextRotationenum andrenderCharImpl<TextRotation>template function that consolidates normal and 90-CW-rotated rendering paths. Hoists theis2Bitconditional above pixel loops (eliminating per-pixel branch). Usesif constexprfor compile-time rotation path selection. Fixes operator precedence bug inbmpValcalculation.lib/GfxRenderer/GfxRenderer.h: ChangedrenderCharsignature (const int* y->int* y). MovedgetGlyphBitmapfrom private to public (needed by the free-function template).
Mod-specific extension
- Extended
TextRotationenum withRotated90CCWand refactoreddrawTextRotated90CCWto delegate to the template. This fixed two bugs in the mod's CCW code:- Operator precedence bug in
bmpVal:3 - (byte >> bit_index) & 0x3->3 - ((byte >> bit_index) & 0x3) - Missing compressed font support: was using raw
bitmap[offset]instead ofgetGlyphBitmap()
- Operator precedence bug in
Recovery of Discarded Changes
During plan-mode dry-run cherry-pick reset, git checkout -- . inadvertently discarded unstaged working tree changes in 12 files (from PRs #1005, #1010, #1003). These were recovered by:
- Cherry-picking upstream commits
cabbfcf(#1005) and63b2643(#1010) with conflict resolution (kept mod'sCrossPointSettings.hinclude) - Fetching unmerged PR #1003 branch and manually applying the diff (ImageBlock::isCached, Page placeholder rendering, EpubReaderActivity phased rendering)
- Committed as
18be265
Build
PlatformIO build succeeded. RAM: 31.5%, Flash: 70.4%.