mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderRolling: quicker partial rerenderings with EPUBs
Only available with EPUBs containing 2 or more fragments, and a file size large enough to ensure a cache file is used. The idea is simply, on any rendering setting change, to skip the rerendering of the full book and to defer any rerendering to the moment we draw a DocFragment, and render only it. So, on a setting change, only the fragment containing the current page will be rerendered, and the new fragments we may cross while turning pages. When having done so, KOReader is in a degraded state (the full page count is incorrect, the ToC is invalid...). So, a full rerendering is needed, and one will happen in the background, and when the user is idle, we reload seamlessly and quickly from the cache file it has made. ReaderFlipping will show some icons in the top left corner to let it know at which steps in this procress we are.
This commit is contained in:
@@ -407,10 +407,12 @@ function ReaderThumbnail:_getPageImage(page)
|
||||
if self.ui.view.highlight.lighten_factor < 0.3 then
|
||||
self.ui.view.highlight.lighten_factor = 0.3 -- make lighten highlight a bit darker
|
||||
end
|
||||
self.ui.highlight.select_mode = false -- Remove any select mode icon
|
||||
|
||||
if self.ui.rolling then
|
||||
-- CRE documents: pages all have the aspect ratio of our screen (alt top status bar
|
||||
-- will be croped out after drawing), we will show them just as rendered.
|
||||
self.ui.rolling.rendering_state = nil -- Remove any partial rerendering icon
|
||||
self.ui.view:onSetViewMode("page") -- Get out of scroll mode
|
||||
if self.ui.font.gamma_index < 30 then -- Increase font gamma (if not already increased),
|
||||
self.ui.document:setGammaIndex(30) -- as downscaling will make text grayer
|
||||
@@ -503,6 +505,7 @@ end
|
||||
|
||||
-- CRE: emitted after a re-rendering
|
||||
ReaderThumbnail.onDocumentRerendered = ReaderThumbnail.resetCache
|
||||
ReaderThumbnail.onDocumentPartiallyRerendered = ReaderThumbnail.resetCache
|
||||
-- Emitted When adding/removing/updating bookmarks and highlights
|
||||
ReaderThumbnail.onBookmarkAdded = ReaderThumbnail.resetCachedPagesForBookmarks
|
||||
ReaderThumbnail.onBookmarkRemoved = ReaderThumbnail.resetCachedPagesForBookmarks
|
||||
|
||||
Reference in New Issue
Block a user