RESOLVED FIXED 43837
[Qt] PathQt should give back pointAtLength and length
https://bugs.webkit.org/show_bug.cgi?id=43837
Summary [Qt] PathQt should give back pointAtLength and length
Dirk Schulze
Reported Wednesday, August 11, 2010 9:21:18 AM UTC
PathQt should give back pointAtLength and length itself. At the moment Qt is using PathTraversalState in Path.cpp, like most other platforms. But I could be a performance win to use qreal percentAtLength ( qreal len ) const QPointF pointAtPercent for pointAtLength and qreal length () const for length().
Attachments
Proposed patch (5.14 KB, patch)
2010-09-01 22:28 PDT, Jan Erik Hanssen
no flags
Proposed patch v2 (3.88 KB, patch)
2010-09-07 23:25 PDT, Jan Erik Hanssen
no flags
Proposed patch v3 (4.21 KB, patch)
2010-09-08 00:43 PDT, Jan Erik Hanssen
no flags
Ariya Hidayat
Comment 1 Wednesday, August 11, 2010 2:36:36 PM UTC
Adding myself.
Jan Erik Hanssen
Comment 2 Thursday, September 2, 2010 6:28:36 AM UTC
Created attachment 66332 [details] Proposed patch
Jan Erik Hanssen
Comment 3 Friday, September 3, 2010 8:58:45 PM UTC
Comment on attachment 66332 [details] Proposed patch The test case for path-totalLength is wrong, it passes for Qt but not any of the other platforms. Will upload a new patch later.
Dirk Schulze
Comment 4 Saturday, September 4, 2010 7:09:51 AM UTC
Sorry, I thougt I commented on this bug. Iam not sure about pointAtLength. IIRC we give back the last possible point if the given length is larger than the totalLength of the path. Can you check this first please?
Jan Erik Hanssen
Comment 5 Tuesday, September 7, 2010 7:53:28 AM UTC
(In reply to comment #4) > Sorry, I thougt I commented on this bug. Iam not sure about pointAtLength. IIRC we give back the last possible point if the given length is larger than the totalLength of the path. Can you check this first please? I'll have a look before uploading a revised patch. Thanks.
Jan Erik Hanssen
Comment 6 Wednesday, September 8, 2010 7:25:21 AM UTC
Created attachment 66847 [details] Proposed patch v2 Adding a test for Path::pointAtLength() for the case where the length argument is beyond the length of the path. Path::length() is already tested.
Dirk Schulze
Comment 7 Wednesday, September 8, 2010 7:39:24 AM UTC
Why did you remove normalAngleAtLength from your first patch. Doen't http://doc.trolltech.com/4.6/qpainterpath.html#angleAtPercent make what you want?
Jan Erik Hanssen
Comment 8 Wednesday, September 8, 2010 7:47:39 AM UTC
(In reply to comment #7) > Why did you remove normalAngleAtLength from your first patch. Doen't http://doc.trolltech.com/4.6/qpainterpath.html#angleAtPercent make what you want? It probably does. Path::normalAngleAtLength() not directly exposed from JS though, making it a bit more tricky to write a test case for that. Probably need to trigger a test via some SVG animation if that's possible (I haven't looked extensively at this yet).
Dirk Schulze
Comment 9 Wednesday, September 8, 2010 7:58:50 AM UTC
(In reply to comment #8) > (In reply to comment #7) > > Why did you remove normalAngleAtLength from your first patch. Doen't http://doc.trolltech.com/4.6/qpainterpath.html#angleAtPercent make what you want? > > It probably does. Path::normalAngleAtLength() not directly exposed from JS though, making it a bit more tricky to write a test case for that. Probably need to trigger a test via some SVG animation if that's possible (I haven't looked extensively at this yet). It is used for text on path in SVG. So if it doesn't work you break some SVG tests. IIRC Qt has pixel tests, so you should recognize it. If you want to check it your own, visit http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/text-path-01-b.html
Jan Erik Hanssen
Comment 10 Wednesday, September 8, 2010 8:34:35 AM UTC
(In reply to comment #9) > It is used for text on path in SVG. So if it doesn't work you break some SVG tests. IIRC Qt has pixel tests, so you should recognize it. If you want to check it your own, visit http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/text-path-01-b.html You're right, LayoutTests/svg/text/text-hkern.svg fails if Path::normalAngleAtLength() returns incorrect results. That should be sufficient for testing this, I'll attach a new patch.
Jan Erik Hanssen
Comment 11 Wednesday, September 8, 2010 8:43:52 AM UTC
Created attachment 66854 [details] Proposed patch v3
Dirk Schulze
Comment 12 Wednesday, September 8, 2010 9:01:32 AM UTC
WebKit Commit Bot
Comment 13 Wednesday, September 8, 2010 3:07:27 PM UTC
Comment on attachment 66854 [details] Proposed patch v3 Clearing flags on attachment: 66854 Committed r66979: <http://trac.webkit.org/changeset/66979>
WebKit Commit Bot
Comment 14 Wednesday, September 8, 2010 3:07:32 PM UTC
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.