add DHINTCOUNT in defaults.lua

It controls how many number of pages will be hinted in background
after one page has been drawn. Default DHINTCOUNT is 2.
pull/273/head
chrox 11 years ago
parent f2cf10a015
commit 979d4c5d48

@ -1,7 +1,11 @@
-- number of page turns between full screen refresh
-- default to full refresh on every page turn
-- default to do a full refresh on every 6 page turns
DRCOUNTMAX = 6
-- number of pages for hinting
-- default to pre-rendering 2 pages
DHINTCOUNT = 2
-- full screen mode, 1 for true, 0 for false
DFULL_SCREEN = 1

@ -3,6 +3,21 @@ ReaderHinting = EventListener:new{
hinting_states = {}
}
function ReaderHinting:onHintPage()
if not self.view.hinting then return true end
for i=1, DHINTCOUNT do
if self.zoom.current_page + i <= self.ui.document.info.number_of_pages then
self.ui.document:hintPage(
self.view.state.page + i,
self.zoom:getZoom(self.view.state.page + i),
self.view.state.rotation,
self.view.state.gamma,
self.view.render_mode)
end
end
return true
end
function ReaderHinting:onSetHinting(hinting)
self.view.hinting = hinting
end
@ -16,4 +31,4 @@ end
function ReaderHinting:onRestoreHinting()
self.view.hinting = table.remove(self.hinting_states)
return true
end
end

@ -161,19 +161,6 @@ function ReaderZooming:onReZoom()
return true
end
function ReaderZooming:onHintPage()
if not self.view.hinting then return true end
if self.current_page < self.ui.document.info.number_of_pages then
self.ui.document:hintPage(
self.view.state.page + 1,
self:getZoom(self.view.state.page + 1),
self.view.state.rotation,
self.view.state.gamma,
self.view.render_mode)
end
return true
end
function ReaderZooming:getZoom(pageno)
-- check if we're in bbox mode and work on bbox if that's the case
local zoom = nil

@ -173,6 +173,7 @@ function ReaderUI:init()
-- hinting controller
local hinter = ReaderHinting:new{
dialog = self.dialog,
zoom = zoomer,
view = self[1],
ui = self,
document = self.document,

@ -1 +1 @@
Subproject commit 1940f8bd8b7c3c7c855d4fc7e1e86ea3f148c015
Subproject commit 88c26d984c3232cdd6d03b19a0da5f6c49351810
Loading…
Cancel
Save