Skip to content

Commit

Permalink
Use high quality refresh for flash updates on color Pocketbooks (#1755)
Browse files Browse the repository at this point in the history
Color Pocketbooks are especially prone to ghosting and normal refresh functions aren't helpful.

This change doesn't fix ghosting in all cases, but whenever one of `refresh...Flash...` functions is called, there will be less (if no) ghosting.

For the cases where we still have ghosting, we should switch to calling one of `refresh...Flash...` API methods.

Fixes koreader/koreader#11416
  • Loading branch information
dmalinovsky committed Apr 2, 2024
1 parent b80105e commit 65d72ed
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ffi/framebuffer_pocketbook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ local function _adjustAreaColours(fb)
end
end

local function _updatePartial(fb, x, y, w, h, dither)
local function _updatePartial(fb, x, y, w, h, dither, hq)
-- Use "hq" argument to trigger high quality refresh for color Pocketbook devices.
x, y, w, h = _getPhysicalRect(fb, x, y, w, h)

fb.debug("refresh: inkview partial", x, y, w, h, dither)
Expand All @@ -32,7 +33,11 @@ local function _updatePartial(fb, x, y, w, h, dither)
_adjustAreaColours(fb)
end

inkview.PartialUpdate(x, y, w, h)
if fb.device.hasColorScreen() and hq then
inkview.PartialUpdateHQ(x, y, w, h)
else
inkview.PartialUpdate(x, y, w, h)
end
end

local function _updateFull(fb, x, y, w, h, dither)
Expand Down Expand Up @@ -123,19 +128,19 @@ end
--[[ framebuffer API ]]--

function framebuffer:refreshPartialImp(x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither, false)
end

function framebuffer:refreshFlashPartialImp(x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither, true)
end

function framebuffer:refreshUIImp(x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither, false)
end

function framebuffer:refreshFlashUIImp(x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither)
_updatePartial(self, x, y, w, h, dither, true)
end

function framebuffer:refreshFullImp(x, y, w, h, dither)
Expand Down

0 comments on commit 65d72ed

Please sign in to comment.