[cairo-commit] src/cairo-xlib-render-compositor.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Feb 8 07:23:18 PST 2013
src/cairo-xlib-render-compositor.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 2d7ac9e737f37daf8490c27e6a04c65bba642645
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Feb 8 15:19:14 2013 +0000
xlib: Only apply the dst offset to the glyph strings once
The elts offset is a delta from the previous glyph coordinate. So by
subtracting the dst origin everytime, we were accumulating a glyph
position error. Instead we just want to offset the starting coordinate
and then always use relative positions.
Reported-by: Theo Veenker <T.J.G.Veenker at uu.nl>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c
index 12f357d..013e2af 100644
--- a/src/cairo-xlib-render-compositor.c
+++ b/src/cairo-xlib-render-compositor.c
@@ -1469,14 +1469,14 @@ _emit_glyphs_chunk (cairo_xlib_display_t *display,
*/
if (_start_new_glyph_elt (j, &glyphs[i])) {
if (j) {
- elts[nelt].nchars = n;
- nelt++;
- n = 0;
+ elts[nelt].nchars = n;
+ nelt++;
+ n = 0;
}
elts[nelt].chars = char8 + size * j;
elts[nelt].glyphset = info->glyphset;
- elts[nelt].xOff = glyphs[i].i.x - dst_x;
- elts[nelt].yOff = glyphs[i].i.y - dst_y;
+ elts[nelt].xOff = glyphs[i].i.x;
+ elts[nelt].yOff = glyphs[i].i.y;
}
switch (width) {
@@ -1579,7 +1579,7 @@ composite_glyphs (void *surface,
cairo_xlib_display_t *display = dst->display;
cairo_int_status_t status = CAIRO_INT_STATUS_SUCCESS;
cairo_scaled_glyph_t *glyph;
- cairo_fixed_t x = 0, y = 0;
+ cairo_fixed_t x = dst_x, y = dst_y;
cairo_xlib_font_glyphset_t *glyphset = NULL, *this_glyphset_info;
unsigned long max_index = 0;
More information about the cairo-commit
mailing list