RESOLVED FIXED Bug 54658
[gtk] Failing collinear arcTo canvas tests
https://bugs.webkit.org/show_bug.cgi?id=54658
Summary [gtk] Failing collinear arcTo canvas tests
Zan Dobersek
Reported 2011-02-17 07:23:12 PST
The following two canvas tests are failing because we do not check for collinearity of the points when arcTo is called. canvas/philip/tests/2d.path.arcTo.collinear.2.html canvas/philip/tests/2d.path.arcTo.collinear.3.html
Attachments
Add collinearity check (2.92 KB, patch)
2011-02-17 07:31 PST, Zan Dobersek
mrobinson: review-
Updated patch (3.43 KB, patch)
2011-02-18 10:09 PST, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2011-02-17 07:31:38 PST
Created attachment 82798 [details] Add collinearity check This patch adds a collinearity check that checks if the three points used to draw an arc through arcTo method are positioned in a line. Check is performed by calculating the area of the triangle that the three points construct - if the area equals zero, the lines are collinear.
Martin Robinson
Comment 2 2011-02-17 15:34:53 PST
Comment on attachment 82798 [details] Add collinearity check View in context: https://bugs.webkit.org/attachment.cgi?id=82798&action=review This is great! We want to make the if statement a little clearer below. > Source/WebCore/platform/graphics/cairo/PathCairo.cpp:187 > + || !(p0.x() * (p1.y() - p2.y()) + p1.x() * (p2.y() - p0.y()) + p2.x() * (p0.y() - p1.y()))) { Please split out the area calculation to a static inline method called something like areaOfTriangleFormedByPoints.
Zan Dobersek
Comment 3 2011-02-18 10:09:44 PST
Created attachment 82974 [details] Updated patch Creates new function for calculating area of a triangle, clears up the checking statement.
Eric Seidel (no email)
Comment 4 2011-02-24 03:18:39 PST
Comment on attachment 82974 [details] Updated patch OK. rs=me.
Eric Seidel (no email)
Comment 5 2011-02-24 03:19:15 PST
CCing folks who understand graphics better than I so they can see this go by.
WebKit Commit Bot
Comment 6 2011-02-24 03:51:43 PST
Comment on attachment 82974 [details] Updated patch Clearing flags on attachment: 82974 Committed r79541: <http://trac.webkit.org/changeset/79541>
WebKit Commit Bot
Comment 7 2011-02-24 03:51:47 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.