fix for Kobo framebuffers: allow for rotation at framebuffer setup

the Kobo framebuffer comes up in landscape mode, that is, landscape
in the other direction as we do it when going into landscape mode.
we leave it this way, and rather allow for a rotation correction at
framebuffer setup.

this PR pulls the relevant changes from koreader-base and makes the
screen code aware of this additional rotation setting.

Kobo framebuffers should now work properly with the new framebuffer
FFI code. They can stay in 16bpp mode and don't change the current
framebuffer settings. They should thus properly interoperate with
the native framework on Kobos as well as sergeys KoboLauncher
(no garbled screen when returning)
This commit is contained in:
HW
2013-11-27 15:57:50 +01:00
parent 23573d8b67
commit af902d1d79
2 changed files with 4 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ Codes for rotation modes:
local Screen = {
cur_rotation_mode = 0,
native_rotation_mode = nil,
blitbuffer_rotation_mode = 0,
bb = nil,
saved_bb = nil,
@@ -42,6 +43,7 @@ local Screen = {
function Screen:init()
self.bb = self.fb.bb
self.blitbuffer_rotation_mode = self.bb:getRotation()
-- asking the framebuffer for orientation is error prone,
-- so we do this simple heuristic (for now)
if self:getWidth() > self:getHeight() then
@@ -103,7 +105,7 @@ function Screen:getScreenMode()
end
function Screen:setRotationMode(mode)
self.fb.bb:rotateAbsolute(-90 * (mode - self.native_rotation_mode))
self.fb.bb:rotateAbsolute(-90 * (mode - self.native_rotation_mode - self.blitbuffer_rotation_mode))
self.cur_rotation_mode = mode
end