-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1257 from NiLuJe/cbb-c99
* CBB: * Reformat in a C99 fashion (tighter scope, restricted pointers). (This makes the diff a horrible mess to read, so, don't, and hope there aren't any more typos than those I already caught ;D). * Made some helper macros available in the header (e.g., GET_BB_*). * Very few logic changes, but a few which'll probably get back to me later :D. * Update the BlitBuffer structs to use unsigned types, and made the fact that stride is a byte count explicit by using a size_t. * Add support for straight-alpha blitFrom (useful for NanoSVG, which spits out straight alpha, unlike MµPDF). * Don't clobber the alpha byte in paintRect & fill (c.f., the tail end of koreader/koreader#6937) * LBB: * Minor updates for feature-parity w/ CBB. * Fair warning about the stride is now size_t thing: a Lua number isn't precise enough to fit the full range of an uint64_t, so, on platforms where size_t is 64bit, it's *not* automatically coerced to a Lua number. The frontend companion PR takes care of the very few cases w<here this matters. * Fix a few instances where the invert flag was mishandled. * Add ZSTD and an FFI binding. * ZSTD is now used by CRe to compress its cache * And it's also used by BookInfo to compress the thumbnails * BookInfo's now unused xutil has been moved to ffi/zlib * Rejig our understanding and usage of the `__gc` metamethod: it doesn't run on plain tables in Lua 5.1, only on userdata. In LuaJIT, it's also usable on cdata metatypes, and cdata finalizers can also be setup explicitly. Convert stuff to the sanest solution in each case, and, in cases where it's not possible, use the hacky workaround of introducing an empty `newproxy` userdata in the mix, via ffi/__gc. This finally solves a number of puzzling code comments that were wondering why the hell our __gc methods were never called (hint: because it's not supported, or, in a few cases it's not supported and they were misnamed anyway ^^). * Tweak lj-sqlite3 to stop coercing BLOBs as Lua strings. Instead return a raw pointer and a byte count, like the SQLite C API. This allows avoiding a few useless copies in BookInfo, our sole user of BLOB. It also just plain makes sense, because if I wanted strings, I'd be using a TEXT column ;). * Use proper symbol visibility discipline for our Lua/C modules, much like was done in nnsvg. This avoids leaking a ton of useless symbols, and makes the dynamic loader's job that much easier. * Update the stbiw version shipped by NanoSVG to the latest one (only used by a CRe helper function). * Fun Valgrind experiments in cre.cpp if DEBUG_CRENGINE is set ;p.
- Loading branch information
Showing
35 changed files
with
4,392 additions
and
2,307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.