Note that bug #4409 (Dashes are missing initial caps) is now fixed.

Move face-flipping from inside _cairo_stroker_add_caps to new _cairo_stroker_add_leading_cap variant of _cairo_stoker_add_cap.
Change to call _cairo_stroker_add_leading_cap or _cairo_stroker_add_trailing_cap as appropriate.
Remove dash-caps-joins from the XFAIL list and add reference image.
This commit is contained in:
Carl Worth 2005-09-27 12:44:32 +00:00
parent 8a6792fe41
commit abaf346810
6 changed files with 58 additions and 20 deletions

View file

@ -1,3 +1,24 @@
2005-09-27 Carl Worth <cworth@cworth.org>
* ROADMAP: Note that bug #4409 (Dashes are missing initial caps)
is now fixed.
* src/cairo-path-stroke.c: (_cairo_stroker_add_cap),
(_cairo_stroker_add_leading_cap),
(_cairo_stroker_add_trailing_cap),
(_cairo_stroker_add_caps): Move face-flipping from inside
_cairo_stroker_add_caps to new _cairo_stroker_add_leading_cap
variant of _cairo_stoker_add_cap.
* src/cairo-path-stroke.c: (_cairo_stroker_line_to_dashed): Change
to call _cairo_stroker_add_leading_cap or
_cairo_stroker_add_trailing_cap as appropriate.
* test/Makefile.am (XFAIL_TESTS):
* test/dash-caps-joins-ref.png:
* test/dash-caps-joins.c: (main): Remove dash-caps-joins from the
XFAIL list and add reference image.
2005-09-27 Carl Worth <cworth@cworth.org>
* test/.cvsignore:

View file

@ -5,7 +5,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=XXXX
✓4260 Antialised font is rendered over green background
✓4299 Assertion fails in "cairo-font.c" when using multithreads
✓4408 Missing dashes on stroked curves
4409 Dashes are missing initial caps
4409 Dashes are missing initial caps
✓4414 SIGILL caused by libcairo when running gnome-terminal
✓PASS clip-all test
4599 Missing wedges on some paths

View file

@ -341,7 +341,7 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st
}
static cairo_status_t
_cairo_stroker_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
_cairo_stroker_add_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
{
cairo_status_t status;
cairo_gstate_t *gstate = stroker->gstate;
@ -411,28 +411,47 @@ _cairo_stroker_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
}
}
static cairo_status_t
_cairo_stroker_add_leading_cap (cairo_stroker_t *stroker,
cairo_stroke_face_t *face)
{
cairo_stroke_face_t reversed;
cairo_point_t t;
reversed = *face;
/* The initial cap needs an outward facing vector. Reverse everything */
reversed.usr_vector.x = -reversed.usr_vector.x;
reversed.usr_vector.y = -reversed.usr_vector.y;
reversed.dev_vector.dx = -reversed.dev_vector.dx;
reversed.dev_vector.dy = -reversed.dev_vector.dy;
t = reversed.cw;
reversed.cw = reversed.ccw;
reversed.ccw = t;
return _cairo_stroker_add_cap (stroker, &reversed);
}
static cairo_status_t
_cairo_stroker_add_trailing_cap (cairo_stroker_t *stroker,
cairo_stroke_face_t *face)
{
return _cairo_stroker_add_cap (stroker, face);
}
static cairo_status_t
_cairo_stroker_add_caps (cairo_stroker_t *stroker)
{
cairo_status_t status;
if (stroker->has_first_face) {
cairo_point_t t;
/* The initial cap needs an outward facing vector. Reverse everything */
stroker->first_face.usr_vector.x = -stroker->first_face.usr_vector.x;
stroker->first_face.usr_vector.y = -stroker->first_face.usr_vector.y;
stroker->first_face.dev_vector.dx = -stroker->first_face.dev_vector.dx;
stroker->first_face.dev_vector.dy = -stroker->first_face.dev_vector.dy;
t = stroker->first_face.cw;
stroker->first_face.cw = stroker->first_face.ccw;
stroker->first_face.ccw = t;
status = _cairo_stroker_cap (stroker, &stroker->first_face);
status = _cairo_stroker_add_leading_cap (stroker, &stroker->first_face);
if (status)
return status;
}
if (stroker->has_current_face) {
status = _cairo_stroker_cap (stroker, &stroker->current_face);
status = _cairo_stroker_add_trailing_cap (stroker, &stroker->current_face);
if (status)
return status;
}
@ -673,7 +692,7 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
/*
* Not first dash in this segment, cap start
*/
status = _cairo_stroker_cap (stroker, &sub_start);
status = _cairo_stroker_add_leading_cap (stroker, &sub_start);
if (status)
return status;
} else {
@ -691,7 +710,7 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
stroker->first_face = sub_start;
stroker->has_first_face = 1;
} else {
status = _cairo_stroker_cap (stroker, &sub_start);
status = _cairo_stroker_add_leading_cap (stroker, &sub_start);
if (status)
return status;
}
@ -701,7 +720,7 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
/*
* Cap if not at end of segment
*/
status = _cairo_stroker_cap (stroker, &sub_end);
status = _cairo_stroker_add_trailing_cap (stroker, &sub_end);
if (status)
return status;
} else {
@ -719,7 +738,7 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
*/
if (first) {
if (stroker->has_current_face) {
status = _cairo_stroker_cap (stroker, &stroker->current_face);
status = _cairo_stroker_add_trailing_cap (stroker, &stroker->current_face);
if (status)
return status;
}

View file

@ -150,7 +150,6 @@ rel-path-ref.png
# provide an explanation for the expected failure.
XFAIL_TESTS = \
a8-mask \
dash-caps-joins \
filter-nearest-offset \
pixman-rotate \
self-intersecting \

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -90,6 +90,5 @@ draw (cairo_t *cr, int width, int height)
int
main (void)
{
return cairo_test_expect_failure (&test, draw,
"Dashes are missing initial caps: https://bugs.freedesktop.org/show_bug.cgi?id=4409");
return cairo_test (&test, draw);
}