Bug 91195 - Some clipped dashed paths not being drawn
Summary: Some clipped dashed paths not being drawn
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-02 17:16 UTC by Tom Klein
Modified: 2018-08-25 13:27 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
clipped dashed line not drawn (1.23 KB, text/plain)
2015-07-02 17:16 UTC, Tom Klein
Details
fix _cairo_box_intersects_line_segment early rejection tests (739 bytes, patch)
2015-07-24 15:56 UTC, Lee Salzman
Details | Splinter Review

Description Tom Klein 2015-07-02 17:16:42 UTC
Created attachment 116882 [details]
clipped dashed line not drawn

Expected results: The portion of the blue line within the gray clipping rectangle should be green.

Actual results: The portion of the blue line within the gray clipping rectangle is red.
Comment 1 Tom Klein 2015-07-02 17:19:07 UTC
This originated from firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=1179859 but seems to still be broken in current cairo.

It looks like there's a bug in _cairo_box_intersects_line_segment.

In the testcase, when 	
    (fully_in_bounds ||
	     (! stroker->has_first_face && stroker->dash.dash_starts_on) ||
	     _cairo_box_intersects_line_segment (&stroker->bounds, &segment))
is tested in _cairo_stroker_line_to_dashed, the first two tests fail, but the third should pass and doesn't.

Inside _cairo_box_intersects_line_segment we get xlen=5120, t1=-58147, and t2=63267, so the 
	if ((t1 < 0 || t1 > xlen) &&
	    (t2 < 0 || t2 > xlen))
	    return FALSE;
test mistakenly returns FALSE.
Comment 2 Lee Salzman 2015-07-24 15:56:02 UTC
Created attachment 117352 [details] [review]
fix _cairo_box_intersects_line_segment early rejection tests

As described by Tom, there seem to be problems with the early rejection tests in _cairo_box_intersects_line_segment, or at least, I could see no logical reason for the way they were written.

Fixing these to verify as expected that the box is either wholly to the left, right, top, or bottom of the line segment, as done in this patch, fixes the issue on these test cases in Firefox. We would appreciate if this patch could get incorporated upstream.
Comment 3 GitLab Migration User 2018-08-25 13:27:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/20.


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.