Summary: | Broken line drawing with cairo graphics using SNA and UXA | ||
---|---|---|---|
Product: | cairo | Reporter: | MaurizioB <maurizio.berti> |
Component: | xlib backend | Assignee: | Chris Wilson <chris> |
Status: | RESOLVED FIXED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Bad strokes
Eliminate precision loss when emitting spline joins Eliminate precision loss when emitting line joins |
Description
MaurizioB
2014-09-20 02:40:36 UTC
The essential of the problem looks to be that the stroke geometry I create in cairo is not accurate, with the error scaling up with line width. Created attachment 106572 [details]
Bad strokes
To demonstrate the problematic path: diff --git a/src/cairo-traps-compositor.c b/src/cairo-traps-compositor.c index 3414fc2..9618e5d 100644 --- a/src/cairo-traps-compositor.c +++ b/src/cairo-traps-compositor.c @@ -2188,7 +2188,7 @@ _cairo_traps_compositor_stroke (const cairo_compositor_t *_compositor, composite_traps_info_t info; unsigned flags; - if (antialias == CAIRO_ANTIALIAS_BEST || antialias == CAIRO_ANTIALIAS_GOOD) { + if (antialias == CAIRO_ANTIALIAS_BEST || antialias == CAIRO_ANTIALIAS_GOOD || 1) { func = _cairo_path_fixed_stroke_polygon_to_traps; flags = 0; } else { i.e. _cairo_path_fixed_stroke_to_traps() is not precise enough. Created attachment 106672 [details] [review] Eliminate precision loss when emitting spline joins Created attachment 106708 [details] [review] Eliminate precision loss when emitting line joins Better patch, now generates strictly correct trapezoids (i.e works with pixman as well this time)! I captured both issues with: commit 80359e73d821516f411b25b977b442869fa5d0ad Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Sep 23 12:58:27 2014 +0100 test: Exercise stroking bugs with xlib/trapezoids Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84115 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> If I'm understanding correctly, both the test case and the fix have landed in the codebase (as commits 80359e73 and 06b9f8fa respectively), and so this bug can be closed. Please reopen if this is incorrect. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.