summaryrefslogtreecommitdiff
path: root/source/fitz/draw-device.c
AgeCommit message (Collapse)Author
2013-11-27Bug 694116: Solve valgrind issues in draw device.Robin Watts
The actual issue here is that a pixmap is dropped more times than it should be due to an error in the rendering pipeline. The problem arises because we fail to push a clip image mask, but still pop the mask off the stack later. This puts us off by 1 in the stack handling. The simplest solution to this (that will be safe no matter what mistakes are made by the caller too) is to add some simple tests in the draw device to ensure we do not free too early.
2013-10-14Handle stroke+fill operations with transparency/blendmodes.Robin Watts
When stroking and filling in a single operation, we are supposed to form the complete stroke+fill image, then blend it back, rather than filling and blending, then stroking and blending. This only matters during transparency, or with non-normal blend modes. We fix MuPDF to push a knockout group when doing such operations.
2013-10-10Rename the draw devices 'stack_max' member to be 'stack_cap'Robin Watts
For consistency with the rest of the code.
2013-09-30Disable image interpolation with a hint.Robin Watts
Set the hint in mudraw when AA bits is set to 0.
2013-09-13Fix various compile warnings spotted by the cluster.Robin Watts
2013-09-02Be smarter when quantising sub pixel positions for glyphs.Robin Watts
For large glyphs, sub pixel positioning is supremely unimportant. Even for smaller glyphs, we don't need 5*5 possible sub pixel positions. Base the degree of sub pixel quantisation on the size of the glyphs. This should result in better cache use. We push all the glyph sub positioning logic into fz_render_glyph (and fz_render_stroked_glyph). This simplifies the calling code. We also tweak fz_render_glyph so that it updates the transform it is called with to reflect the sub pixel positioning. This solves various problems: Firstly, we can round positions both up and down to achieve a smaller net displacement (e.g. (0.99, 0.99) can go to (1,1) rather than (0.75, 0.75) if we have a subpixel position resolution of 1/4 pixels). Secondly, glyphs that are drawn from outlines will have exactly the same subpixel changes applied. This is unlikely to be noticable, but it does mean that baselines should avoid having any shifts in them. Finally, it enables us to avoid lots of unnecessary copying of matrices, hopefully reducing overhead.
2013-08-30Use RLE coding scheme for glyph bitmaps.Robin Watts
Rather than generating fz_pixmaps for glyphs, we generate fz_glyphs. fz_glyphs can either contain a pixmap, or an RLEd representation (if it's a mask, and it's smaller). Should take less memory in the cache, and should be faster to plot.
2013-07-24Fix memory overwrites when plotting glyphs that are completely clipped.Robin Watts
This bug has been in here for ages, but was masked by a bug in the gel clipping that was fixed by Tor earlier.
2013-06-20Rename fz_image_to_pixmap to fz_new_pixmap_from_image.Tor Andersson
Match our naming conventions.
2013-06-20Rearrange source files.Tor Andersson