From a025863f54a861529127b2abcc253151b9054774 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 13 Dec 2021 02:15:00 +0100 Subject: [PATCH] TileCache: Preserve BlitBuffer's inversion & rotation (#8547) * TileCache: Preserve BlitBuffer's inversion & rotation This somehow fell through the cracks for all these years ;). (We can't simply save the config field directly, because bb.fromstring always generates an allocated bb, which may not be the case of the source bb). * Bump base https://github.com/koreader/koreader-base/pull/1440 --- base | 2 +- frontend/document/tilecacheitem.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base b/base index eb1285d2e..2e5359257 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit eb1285d2e3e20ecf886695a474cae11e556c3437 +Subproject commit 2e53592573718a59399df1739a92b39cf8d92e2d diff --git a/frontend/document/tilecacheitem.lua b/frontend/document/tilecacheitem.lua index 60b4b6214..6ac9cef04 100644 --- a/frontend/document/tilecacheitem.lua +++ b/frontend/document/tilecacheitem.lua @@ -24,6 +24,8 @@ function TileCacheItem:totable() h = self.bb.h, stride = tonumber(self.bb.stride), fmt = self.bb:getType(), + rotation = self.bb:getRotation(), + inverse = self.bb:getInverse(), data = Blitbuffer.tostring(self.bb), }, } @@ -54,7 +56,7 @@ function TileCacheItem:fromtable(t) self.excerpt = t.excerpt self.created_ts = t.created_ts self.persistent = t.persistent - self.bb = Blitbuffer.fromstring(t.bb.w, t.bb.h, t.bb.fmt, t.bb.data, t.bb.stride) + self.bb = Blitbuffer.fromstring(t.bb.w, t.bb.h, t.bb.fmt, t.bb.data, t.bb.stride, t.bb.rotation, t.bb.inverse) end function TileCacheItem:load(filename)