diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-08-28 15:18:37 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-09-02 11:40:13 +0100 |
commit | da277059b37380d57028ff79a636f4d725c96e8f (patch) | |
tree | 21140720e22a819b863a64160fca6a4dec2be714 /source/fitz/load-jpx.c | |
parent | 2b2c67836932b1dada7f7f28e42fe4ed06c4e4ed (diff) | |
download | mupdf-da277059b37380d57028ff79a636f4d725c96e8f.tar.xz |
Be smarter when quantising sub pixel positions for glyphs.
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.
Diffstat (limited to 'source/fitz/load-jpx.c')
0 files changed, 0 insertions, 0 deletions