summaryrefslogtreecommitdiff
path: root/source/fitz/draw-paint.c
AgeCommit message (Collapse)Author
2017-06-29Fix typos in blend mode maths comment.Robin Watts
2017-05-09Fix plotter bug.Robin Watts
We were passing in the wrong source alpha value in one of the plotter calls. This is not a call used in our standard builds, hence us not having seen the problem before. Credit to Sebastian for spotting the problem and suggesting the fix.
2017-05-09Fix incorrect sa value passed in a plotter.Robin Watts
Should be 0..256 not 0..1
2017-04-27Include required system headers.Tor Andersson
2016-11-07Bug 697241: Fix blending through clips.Robin Watts
Non rectangular clips are currently handled by rendering to a 'isolated' background, and then plotting that through a mask. This runs into problems when the rendering needs to use non standard blend modes that need to access the background colors. Instead, copy the background to the new pixmap, render to that then plot that through the mask. This simplifies the painting code, because we now never have mismatched source and destination alphas.
2016-10-07More SWAR optimisation in plotters.Robin Watts
Slightly revised blending, making use of the fact that we can no longer overflow due to ma + masa <= 0x100.
2016-10-07SWAR optimisation in plotters.Robin Watts
2016-10-07Correct maths error in painters.Robin Watts
As part of the blending calculations, we do: dst = src * mask_alpha + dst * (1-mask_alpha.src_alpha) We calculate mask_alpha as ma, and 1-mask_alpha.src_alpha as masa. In full accuracy, we should never have ma + masa >= 1. Unfortunately, with the formulation used in the painters at the moment, we can. We therefore rejig the calculations slightly.
2016-10-07Optimise painters: Use SWAR to accelerate plotting.Robin Watts
Used for the file from bug 697122. Makes a small improvement overall. (31.3s to 31s for a cutdown file). The equivalent code using 64bit operations is slower.
2016-10-07Tweak painters: If painting 0 alpha, skip it.Robin Watts
2016-10-07Tweak painters.Robin Watts
If we have a source alpha, and it's 0, then nothing to paint.
2016-07-20Fix missing alpha only plotter.Robin Watts
Spotted with: mutool draw -A0 -r600 -o out.ppm J11_acrobat.pdf
2016-07-08Bug 696872: Avoid trying to paint with zero alpha.Robin Watts
Short circuit any attempt to paint a pixmap with zero alpha.
2016-06-16Silence warnings.Tor Andersson
2016-06-06Fix problem with FZ_PLOTTER_G only builds.Robin Watts
In C we can't have a label as the only thing in a block.
2016-05-30Ensure that we can use FZ_PLOTTERS_N instead of FZ_PLOTTERS_RGB.Robin Watts
2016-05-30Add config.h include file.Robin Watts
Introduce FZ_PLOTTER defines to set which defines we required. Add FZ_ENABLE define to set which document handlers are built by default.
2016-05-29Accelerate common n=3 color case.Robin Watts
2016-05-29Tweak plotter code slightly for speed.Robin Watts
Use do {} while(--w) rather than while(w--) {} as this safes a test each time around the loop.
2016-05-29Improve speed of fz_paint_solid_color and friends.Robin Watts
2016-05-29Split draw-paint.c plotters out into separate functions.Robin Watts
Again, mainly so profiling works nicely.
2016-05-27Add facility to track usage of functions.Robin Watts
Use this for plotters so we can see which ones are being used in any given build. Build with -DTRACK_USAGE to enable.
2016-05-24Fix optimisation in fz_paint_affine_N_nearRobin Watts
Only do int to int copying if we have an int to copy from. Also, when copying int to int, copy int32_t to int32_t to make us more future proof.
2016-05-24Sprinkle some consts and restricts in plotters.Robin Watts
Try and help C avoid pointer aliasing issues. Some of this may not help at all. None of it should hurt though.
2016-05-24fz_pixmap revamp: add stride and make alpha optionalRobin Watts
fz_pixmaps now have an explicit stride value. By default no change from before, but code all copes with extra gaps at the end of the line. The alpha data in fz_pixmaps is no longer compulsory. mudraw: use rgb not rgba (ppmraw), cmyk not cmyka (pkmraw). Update halftone code to not expect alpha plane. Update PNG writing to cope with alpha less input. Also hide repeated params within the png output context. ARM code needs updating.
2016-05-16Fit another mistake in cmyk plotters.Robin Watts
2016-05-13Fix error in CMYK plotters.Robin Watts
2016-03-25Optimise fz_paint_solid_color_5Robin Watts
2016-03-22Remove dead code.Robin Watts
2016-03-16glyph plotter; Use repeated inclusion of headerRobin Watts
To avoid having to duplicate a fairly large block of code several times, use repeated inclusion of a header with some macros to generate optimised glyph plotters.
2016-03-16Add optimised CMYK plotters.Robin Watts
We have optimised plotters for 2 and 4 components (i.e. greyscale and rgb). Add equivalent ones for CMYK.
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-08-28Fix big endian operation of paint code.Robin Watts
Broken in recent optimisations.
2013-08-26Optimise fz_paint_scan_with_color and fz_paint_spanRobin Watts
2013-08-26Remove conditional code from draw-paint.cRobin Watts
If we want the alternative versions we can pull them out of git later.
2013-08-26Optimise fz_paint_span_with_color and fz_paint_solid_colorRobin Watts
The 2 biggest hotspots in benchmarking on the Raspberry pi at 1200dpi.
2013-06-20Rearrange source files.Tor Andersson