Bug 69817 - [skia] Implement Path.currentPoint for skia
Summary: [skia] Implement Path.currentPoint for skia
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ben Wells
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-10 22:39 PDT by Ben Wells
Modified: 2011-10-12 16:58 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2011-10-10 22:43 PDT, Ben Wells
no flags Details | Formatted Diff | Diff
Patch (1.53 KB, patch)
2011-10-11 21:26 PDT, Ben Wells
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Wells 2011-10-10 22:39:45 PDT
[skia] Implement Path.currentPoint for skia
Comment 1 Ben Wells 2011-10-10 22:43:55 PDT
Created attachment 110476 [details]
Patch
Comment 2 Ben Wells 2011-10-10 23:22:29 PDT
I implemented this function while working another bug but it wasn't needed. It might come in handy in future for someone else or prevent cross platform problems creeping in if this function is used in future by developers of other ports.

It is used in the canvas code to work out if a line, arc etc. will be zero length and therefore whether it should be added or not. The zero length segments get filtered out later so there should be no impact of the change. Tests all pass with the change.
Comment 3 Mike Reed 2011-10-11 04:57:39 PDT
Looks fine. You could also just call skiaPath.getLastPt(), but you'll still need the check for count==0. The next rev. of getLastPt returns a bool which indicates if the lastPt is valid. This would simplify the impl as well when that lands...
Comment 4 Kenneth Russell 2011-10-11 10:35:22 PDT
Comment on attachment 110476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=110476&action=review

Looks fine but there's a problem with the ChangeLog that will cause it to be rejected from the commit queue.

> Source/WebCore/ChangeLog:10
> +        No new tests. (OOPS!)

You'll need to remove this OOPS line. Also ideally there would be a test case.
Comment 5 Ben Wells 2011-10-11 21:26:08 PDT
Created attachment 110633 [details]
Patch
Comment 6 Ben Wells 2011-10-11 21:27:22 PDT
I'm not sure how to test this with a new layout test. Any advice?
Comment 7 Kenneth Russell 2011-10-12 12:41:35 PDT
(In reply to comment #6)
> I'm not sure how to test this with a new layout test. Any advice?

Did you search the code base for uses of Path.currentPoint() and see if there's any way to get it called from JavaScript, for example via a series of Canvas calls?
Comment 8 Kenneth Russell 2011-10-12 12:41:50 PDT
Comment on attachment 110633 [details]
Patch

Looks fine. r=me
Comment 9 Ben Wells 2011-10-12 15:23:35 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > I'm not sure how to test this with a new layout test. Any advice?
> 
> Did you search the code base for uses of Path.currentPoint() and see if there's any way to get it called from JavaScript, for example via a series of Canvas calls?

Yes I searched for where currentPoint is used when making the change, its not exposed anywhere with easy access like that.
Comment 10 WebKit Review Bot 2011-10-12 15:25:59 PDT
Comment on attachment 110633 [details]
Patch

Rejecting attachment 110633 [details] from commit-queue.

aboxhall@chromium.org does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 11 WebKit Review Bot 2011-10-12 16:58:55 PDT
Comment on attachment 110633 [details]
Patch

Clearing flags on attachment: 110633

Committed r97319: <http://trac.webkit.org/changeset/97319>
Comment 12 WebKit Review Bot 2011-10-12 16:58:59 PDT
All reviewed patches have been landed.  Closing bug.