mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
"Simplify" HW/SW dithering checks
Make it a real Document property, updated at init & toggle time. Also, simplify a bunch of redundant nested lookups in ReaderView (self.ui.view is self, self.ui.document is self.document).
This commit is contained in:
@@ -26,6 +26,15 @@ function PicDocument:init()
|
||||
self.info.has_pages = true
|
||||
self.info.configurable = false
|
||||
|
||||
-- Enforce dithering in PicDocument
|
||||
if CanvasContext:hasEinkScreen() then
|
||||
if CanvasContext:canHWDither() then
|
||||
self.hw_dithering = true
|
||||
elseif CanvasContext.fb_bpp == 8 then
|
||||
self.sw_dithering = true
|
||||
end
|
||||
end
|
||||
|
||||
self:_readMetadata()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user