"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:
NiLuJe
2022-02-06 18:01:45 +01:00
parent afe1dc9681
commit 35776f1f87
5 changed files with 90 additions and 47 deletions

View File

@@ -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