Bug 54471

Summary: [GTK][CAIRO] Some canvas arc tests fail because of a bug in Cairo arc rendering
Product: WebKit Reporter: Zan Dobersek <zan>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: d-r, leandro, mdelaney7, mrobinson, otte, rakuco
Priority: P2 Keywords: Gtk, LayoutTestFailure
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 54458    
Attachments:
Description Flags
Comparison image
none
Use smaller tolerance none

Description Zan Dobersek 2011-02-15 09:24:37 PST
Created attachment 82473 [details]
Comparison image

There are two tests that fail because Cairo's preset tolerance is too big.

The tests are:
-canvas/philip/tests/2d.path.arc.selfintersect.1.html
-canvas/philip/tests/2d.path.arc.shape.3.html

Both tests draw arcs, but arcs in Cairo are drawn by being split into segments. Because of the default tolerance being too big these segments are not precise enough (there are too many and are too big) so they end up expanding the arc furthermore, making these tests fail.

I'm attaching a comparison image that furthermore illustrates the problem.
Comment 1 Zan Dobersek 2011-02-15 10:06:27 PST
Created attachment 82480 [details]
Use smaller tolerance

This patch sets Cairo's tolerance to 0.01 and enables two canvas tests that now succeed.
Comment 2 Benjamin Otte 2011-02-15 11:43:56 PST
This is a Cairo bug. I committed a testcase to the cairo testsuite at http://cgit.freedesktop.org/cairo/commit/?id=4d4056872db94573183473610ad1d81d5439fdc6 and hope our developers will take care of it there.

Increasing the tolerance hides this bug (just increase the test size to get it back) at the cost of performance, so it's definitely not the right fix.
Comment 3 Martin Robinson 2011-02-15 13:54:41 PST
(In reply to comment #2)
> This is a Cairo bug. I committed a testcase to the cairo testsuite at http://cgit.freedesktop.org/cairo/commit/?id=4d4056872db94573183473610ad1d81d5439fdc6 and hope our developers will take care of it there.
> 
> Increasing the tolerance hides this bug (just increase the test size to get it back) at the cost of performance, so it's definitely not the right fix.


Thanks for the update, Benjamin. Is there a work-around (other than decreasing the tolerance) that we can make on our side? I'm guessing not. :(
Comment 4 Benjamin Otte 2011-02-15 13:56:46 PST
I can't think of a workaround, no.
Comment 5 Zan Dobersek 2011-02-15 21:59:12 PST
Comment on attachment 82480 [details]
Use smaller tolerance

Removing the review flag.
Comment 6 Martin Robinson 2011-02-24 14:34:42 PST
(In reply to comment #5)
> (From update of attachment 82480 [details])
> Removing the review flag.

Benjamin, is there a bug report somewhere so we can track this and unskip the tests once the bots have the appropriate version of Cairo?
Comment 7 Zan Dobersek 2011-03-06 11:55:10 PST
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 82480 [details] [details])
> > Removing the review flag.
> 
> Benjamin, is there a bug report somewhere so we can track this and unskip the tests once the bots have the appropriate version of Cairo?

A test case has already been committed into cairo tree[1], but I do not think this has been fixed yet.

[1] http://cgit.freedesktop.org/cairo/commit/?id=4d4056872db94573183473610ad1d81d5439fdc6
Comment 8 Dominik Röttsches (drott) 2012-09-26 04:44:53 PDT
This is fixed in newer versions of cairo, we're working on bumping it in bug 97658.

*** This bug has been marked as a duplicate of bug 97658 ***