diff --git a/ffi/framebuffer_android.lua b/ffi/framebuffer_android.lua index 876e7e27e..715b38bc2 100644 --- a/ffi/framebuffer_android.lua +++ b/ffi/framebuffer_android.lua @@ -11,14 +11,8 @@ local has_eink_screen, eink_platform = android.isEink() -- does the device needs to handle all screen refreshes local has_eink_full_support = android.isEinkFull() --- for *some* rockchip devices -local rk_full, rk_partial, rk_a2, rk_auto = 1, 2, 3, 4 -- luacheck: ignore --- for *some* freescale devices -local update_full, update_partial = 32, 0 -- luacheck: ignore -local waveform_du, waveform_gc16, waveform_regal = 1, 2, 7 -- luacheck: ignore -local partial_du, partial_gc16, partial_regal = waveform_du, waveform_gc16, waveform_regal -- luacheck: ignore -local full_gc16, full_regal = update_full + waveform_gc16, update_full + waveform_regal -- luacheck: ignore +local full, partial, full_ui, partial_ui, fast, delay_page, delay_ui, delay_fast = android.getEinkConstants() local framebuffer = {} @@ -35,18 +29,18 @@ end -- update the entire screen function framebuffer:_updateFull() -- freescale ntx platform - if has_eink_screen and (eink_platform == "freescale") then + if has_eink_screen and (eink_platform == "freescale" or eink_platform == "qualcomm") then if has_eink_full_support then - -- we handle the screen entirely. No delay is needed - self:_updatePartial(full_gc16, 0) + -- we handle the screen entirely + self:_updatePartial(full, delay_page) else -- we're racing against system driver. Let the system win and apply -- a full update after it. - self:_updatePartial(full_gc16, 500) + self:_updatePartial(full, 500) end -- rockchip rk3x platform elseif has_eink_screen and (eink_platform == "rockchip") then - android.einkUpdate(rk_full) + android.einkUpdate(full) end end @@ -141,7 +135,7 @@ function framebuffer:_updateWindow() android.lib.ANativeWindow_unlockAndPost(android.app.window); end -function framebuffer:refreshFullImp(x, y, w, h) +function framebuffer:refreshFullImp(x, y, w, h) -- luacheck: ignore self:_updateWindow() self:_updateFull() end @@ -149,35 +143,35 @@ end function framebuffer:refreshPartialImp(x, y, w, h) self:_updateWindow() if has_eink_full_support then - self:_updatePartial(partial_regal, 0, x, y, w, h) + self:_updatePartial(partial, delay_page, x, y, w, h) end end function framebuffer:refreshFlashPartialImp(x, y, w, h) self:_updateWindow() if has_eink_full_support then - self:_updatePartial(full_regal, 0, x, y, w, h) + self:_updatePartial(full, delay_page, x, y, w, h) end end function framebuffer:refreshUIImp(x, y, w, h) self:_updateWindow() if has_eink_full_support then - self:_updatePartial(partial_regal, 0, x, y, w, h) + self:_updatePartial(partial_ui, delay_ui, x, y, w, h) end end function framebuffer:refreshFlashUIImp(x, y, w, h) self:_updateWindow() if has_eink_full_support then - self:_updatePartial(full_regal, 0, x, y, w, h) + self:_updatePartial(full_ui, delay_ui, x, y, w, h) end end function framebuffer:refreshFastImp(x, y, w, h) self:_updateWindow() if has_eink_full_support then - self:_updatePartial(partial_du, 0, x, y, w, h) + self:_updatePartial(fast, delay_fast, x, y, w, h) end end