Skip to content

Commit

Permalink
TileCache: Preserve BlitBuffer's inversion & rotation (#8547)
Browse files Browse the repository at this point in the history
* 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

koreader/koreader-base#1440
  • Loading branch information
NiLuJe committed Dec 13, 2021
1 parent 5ed22ca commit a025863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base
Submodule base updated 2 files
+7 −1 ffi/blitbuffer.lua
+14 −8 ffi/mupdf.lua
4 changes: 3 additions & 1 deletion frontend/document/tilecacheitem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a025863

Please sign in to comment.