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
reviewable/pr8554/r1
NiLuJe 2 years ago committed by GitHub
parent 5ed22cafb5
commit a025863f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit eb1285d2e3e20ecf886695a474cae11e556c3437 Subproject commit 2e53592573718a59399df1739a92b39cf8d92e2d

@ -24,6 +24,8 @@ function TileCacheItem:totable()
h = self.bb.h, h = self.bb.h,
stride = tonumber(self.bb.stride), stride = tonumber(self.bb.stride),
fmt = self.bb:getType(), fmt = self.bb:getType(),
rotation = self.bb:getRotation(),
inverse = self.bb:getInverse(),
data = Blitbuffer.tostring(self.bb), data = Blitbuffer.tostring(self.bb),
}, },
} }
@ -54,7 +56,7 @@ function TileCacheItem:fromtable(t)
self.excerpt = t.excerpt self.excerpt = t.excerpt
self.created_ts = t.created_ts self.created_ts = t.created_ts
self.persistent = t.persistent 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 end
function TileCacheItem:load(filename) function TileCacheItem:load(filename)

Loading…
Cancel
Save