Don't show SW dither toggle on devices w/ HW dithering

reviewable/pr8794/r1
NiLuJe 2 years ago
parent 3122bcd9bc
commit afe1dc9681

@ -190,7 +190,7 @@ local settingsList = {
kopt_contrast = {category="absolutenumber", paging=true},
kopt_page_opt = {category="configurable", paging=true},
kopt_hw_dithering = {category="configurable", paging=true, condition=Device:hasEinkScreen() and Device:canHWDither()},
kopt_sw_dithering = {category="configurable", paging=true, condition=Device:hasEinkScreen() and Device.screen.fb_bpp == 8},
kopt_sw_dithering = {category="configurable", paging=true, condition=Device:hasEinkScreen() and not Device:canHWDither() and Device.screen.fb_bpp == 8},
kopt_quality = {category="configurable", paging=true},
kopt_doc_language = {category="string", paging=true},
kopt_forced_ocr = {category="configurable", paging=true},

@ -497,7 +497,8 @@ function Document:drawPage(target, x, y, rect, pageno, zoom, rotation, gamma, re
local tile = self:renderPage(pageno, rect, zoom, rotation, gamma, render_mode)
-- Enable SW dithering if requested (only available in koptoptions)
-- Much Like ReaderView, also enforce SW dithering in PicDocument if the device can't do HW dithering...
if (self.is_pic and CanvasContext:hasEinkScreen() and not CanvasContext:canHWDither() and CanvasContext.fb_bpp == 8) or (self.configurable.sw_dithering and self.configurable.sw_dithering == 1) then
if (self.is_pic and CanvasContext:hasEinkScreen() and not CanvasContext:canHWDither() and CanvasContext.fb_bpp == 8)
or (self.configurable.sw_dithering and self.configurable.sw_dithering == 1) then
target:ditherblitFrom(tile.bb,
x, y,
rect.x - tile.excerpt.x,

@ -497,7 +497,7 @@ This can also be used to remove some gray background or to convert a grayscale o
},
{
name = "hw_dithering",
name_text = _("HW Dithering"),
name_text = _("Dithering"),
toggle = {_("off"), _("on")},
values = {0, 1},
default_value = 0,
@ -508,12 +508,12 @@ This can also be used to remove some gray background or to convert a grayscale o
},
{
name = "sw_dithering",
name_text = _("SW Dithering"),
name_text = _("Dithering"),
toggle = {_("off"), _("on")},
values = {0, 1},
default_value = 0,
advanced = true,
show = Device:hasEinkScreen() and Device.screen.fb_bpp == 8,
show = Device:hasEinkScreen() and not Device:canHWDither() and Device.screen.fb_bpp == 8,
name_text_hold_callback = optionsutil.showValues,
help_text = _([[Enable software dithering.]]),
},

Loading…
Cancel
Save