summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-04-26Fix dirty flag handling bug in X11 event loop.Robin Watts
When I added transition handling to mupdf, I broke the X11 behaviour of coalescing all events and only blitting when idle. This commit restores that behaviour, except when transitions are actually in progress (when it still blits instantly).
2013-04-26Bug 693845: Vertical motion in PDF.Robin Watts
Ignore sign of font size when calculating X offset in vertical motion for fonts.
2013-04-26Fix SNAFU in the store handling.Robin Watts
When the store fills up, the existing code throws away items to make room. Due to a silly oversight (not updating the 'size' after each round of evictions) it keeps throwing away repeatedly until it fails. Fix that here. Should make the store more efficient.
2013-04-26Multi-threaded store SEGV fixes and debug improvements.Robin Watts
Fix race condition in the store. When storing an item, we immediately put it into the hash (thus getting our existence check). We then check and try to free enough space for it in the budget. If we cannot free enough, we remove the item from the hash. The race condition comes if someone else finds it in the hash in the meantime. To fix this, we update all 'finds' of things in the hash to move it to the head of the LRU chain (regardless of whether it was in the chain before or not). We only remove it from the hash in the 'failed-to-fit-in-the-budget' case if it's not in the chain already. Also, we fix a bug in the "failed to fit" removal case where we were failing to realise that the the pos pointer was not valid any more. In the course of tracking this bug down various debug functions were improved. These are committed here too.
2013-04-26Squash 2 const warnings.Robin Watts
Add some more consts's and use void *'s where appropriate.
2013-04-26Add image output for HTML.Robin Watts
JPEGs and PNGs are left unchanged. Any other image gets stored as a PNG and sent as a data URL.
2013-04-26Hint enabling/disabling for devices.Robin Watts
Add configuration functions to control the hints set on a given device. Use this to set whether image data is captured or not in the text extraction process. Also update the display list device to respect the device hints during playback.
2013-04-25Generalise fz_write_png to fz_output_pixmap_to_pngRobin Watts
Extract the core of fz_write_png so that it can work to an fz_output * rather than a FILE *. fz_write_png continues to work as before, but now we can output to buffer to.
2013-04-25Add fz_write method for output streams.Robin Watts
2013-04-25Tweak fz_text_page to include image records.Robin Watts
Extract such records as part of the text device.
2013-04-23Fix pkg-config issues.Tor Andersson
Only evaluate pkg-config variables if using system libraries, using a := assignment in Makethird. This silences warnings if the library is in thirdparty but not installed on the system.
2013-04-22Fix various multi-threading problems with the store.Robin Watts
When resizing the hash table, we have a special case to cope with someone else resizing the table before we get a chance to. In this rare situation we were unlocking (regardless of whether we should have been), and failing to relock. Fixed here. When storing an item, I recently changed the code to put the new item into the hash before ensuring that we had enough space. This change was motivated by us wanting not to evict to make room only to find that we didn't need the room as there was a duplicate entry anyway. In so doing, this opened up a potential race condition where another thread could 'find' the item from the hash before it had been filled out. To solve this, we move the "filling out" of the item entries earlier in the function. Another problem is found due to the same block of code; as soon as a new item is put into the hash, it can be found elsewhere. Any attempt to manipulate it's linked list will fail. We therefore set all new items with their prev/next pointers pointing to themselves, enabling us to spot this special case and avoid corrupting the linked list.
2013-04-19When triangulating quads, send edges in consistent order.Robin Watts
Due to the underlying implementation, this probably doesn't make a difference. But it's more aesthetically pleasing. Most importantly, add a comment so we know what the tradeoffs are here.
2013-04-19Rename internal mesh processing functions.Robin Watts
Be more consistent. No user visible changes.
2013-04-19Add new function to return the accurate bbox of a path.Robin Watts
As requested by customer 530.
2013-04-19Optimised mesh bounding functionsRobin Watts
Don't decompose meshes just to find their bbox.
2013-04-18Android: Fix V8_BUILD makefile logic.Robin Watts
V8_OK needs to be set before the includes. LOCAL_LDLIBS need to be set after them.
2013-04-16Avoid expanding path for stroke twice.Robin Watts
fz_bound_path already takes care of stroke expansion - don't apply it twice.
2013-04-16android: More string cleanups.Tor Andersson
2013-04-16Mesh painting optimisation; tensor patch color splitting.Robin Watts
Only split as many components of colors in the tensor patch as we actually use.
2013-04-16Avoid more needless copying in mesh processingRobin Watts
Apply the same optimisations to mesh type 6 as were just applied to mesh type 7.
2013-04-16Try to copy less needless information in mesh processingRobin Watts
2013-04-16Bug 693851: Performance improvement for shadingsRobin Watts
Avoid needless copies. Thanks to Christophe from customer 530 for the original version of this patch. Also tweak clipx and clipy so that both intersection calculations in each rotuine are identical.
2013-04-15Bug 692681: Pull SoftMask invocation logic togetherRobin Watts
Softmasks can be applied in 2 places in our code; once when starting a group, once when running an XObject. The two implementations had drifted apart. To avoid this in future, pull the two together. This solves the bug, apart from the issue of transfer functions not working. Also, fix another issue seen in cluster testing. For luminance smasks the bbox is only used to clip the contents drawn - the background color extends into the surrounding area. Fix the code to respect this. And another problem; text in soft masks would upset text outside the SMasks - fix this by storing/restoring the text settings in the interpreter state around the smask rendering.
2013-04-11Remove fz_load_jpeg as now unused.Robin Watts
2013-04-11Move pdf_image to fz_image.Robin Watts
In order to be able to output images (either in the pdfwrite device or in the html conversion), we need to be able to get to the original compressed data stream (or else we're going to end up recompressing images). To do that, we need to expose all of the contents of pdf_image into fz_image, so it makes sense to just amalgamate the two. This has knock on effects for the creation of indexed colorspaces, requiring some of that logic to be moved. Also, we need to make xps use the same structures; this means pushing PNG and TIFF support into the decoding code. Also we need to be able to load just the headers from PNG/TIFF/JPEGs as xps doesn't include dimension/resolution information. Also, separate out all the fz_image stuff into fitz/res_image.c rather than having it in res_pixmap.
2013-04-11win32: use unicode functions for password dialog.Tor Andersson
2013-04-11Convert UTF-8 passwords to correct encoding.Tor Andersson
PDFDocEncoding for crypt revisions <= 4, UTF-8 for newer.
2013-04-11Remove explicit architecture settings in Makerules for OS X.Tor Andersson
2013-04-11android: Clean up string resources.Tor Andersson
2013-04-10Don't roll the softmask matrix too early.Robin Watts
Previously we combined the softmask xobject->matrix with the ctm to make gstate->softmask_ctm at load time. This meant that when we ran the softmask xobject the xobject->matrix was reapplied a second time. The fix is to keep the xobject->matrix out and apply it manually whereever we use the softmask_ctm (which is just for the bbox transformation currently).
2013-04-10Treat missing TR in SoftMask as identity.Robin Watts
2013-04-09Android: Ensure mTopBarMode is initialisedRobin Watts
Otherwise loading calc.pdf and clicking buttons causes a null pointer exception.
2013-04-09Android: Remove import of java.util.DequeRobin Watts
We have this as a local class, and the import was a hangover from old code that stops it working on Froyo/Gingerbread.
2013-04-09Disable V8 usage on armeabi - only for armeabi-v7a for now.Robin Watts
Until someone can get me v8 libs that work on armeabi at least!
2013-04-09Android: handle features not supported other than for PDF filesPaul Gardiner
2013-04-09Android: new, more-logical menu hierarchyPaul Gardiner
2013-04-08Android: Fix operation under Froyo/Gingerbread.Robin Watts
Android resolves references at class load time, so when MuPDFActivity is loaded, it tries to resolve AnimatorInflater. This fails on a 2.2 system. The fix is to push the code into 'SafeAnimatorInflater'. When MuPDFActivity is loaded, SafeAnimatorInflater is resolved, but it's not actually loaded until it's used. We never use it unless we have at least honeycomb, hence we never try to resolve the missing class.
2013-04-04Fix usage string for mudrawRobin Watts
The "-G gamma" entry in the usage string was different in style to all the other entries.
2013-04-04Android: quicker response to print failurePaul Gardiner
2013-04-03Android: avoid SEGV when printing fails, and display errorPaul Gardiner
2013-04-03Updated print icons.Robin Watts
Less 'pretty', but more in the style of the others.
2013-04-03Android: prepare for localisationPaul Gardiner
2013-04-03Use xml onClick field to avoid some of the explicit Button objectsPaul Gardiner
2013-03-29Avoid uncompressing indexed images at load time.Robin Watts
This actually turned out to be far easier than I'd feared; remove the explicit check that stopped this working, and ensure that we pass the correct value in for the 'indexed' param. Add a function to check for colorspaces being indexed. Bit nasty that this requires a strcmp...
2013-03-29Move bpc into fz_imageRobin Watts
2013-03-29Bug 693467: Updated .desktop file for debian.Robin Watts
Thanks to Michael Weber.
2013-03-29Android: some user-feedback improvementsPaul Gardiner
Disable some features when in reflow mode Disable features when document format prohibits Add a few instructional on-scrren, info messages
2013-03-29Android: initial support for printingPaul Gardiner
This wont work for other than PDF documents Also, we should save the file before printing if it has been changed
2013-03-27Android: fix git rebase slipPaul Gardiner