Bug 42188 - Failing 2d.path.stroke.prune.arc philip canvas test
Summary: Failing 2d.path.stroke.prune.arc philip canvas test
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Matthew Delaney
URL:
Keywords:
Depends on:
Blocks: 42190
  Show dependency treegraph
 
Reported: 2010-07-13 13:25 PDT by Matthew Delaney
Modified: 2010-07-16 17:08 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.26 KB, patch)
2010-07-14 14:27 PDT, Matthew Delaney
no flags Details | Formatted Diff | Diff
Patch (9.77 KB, patch)
2010-07-14 17:42 PDT, Matthew Delaney
no flags Details | Formatted Diff | Diff
Patch (9.77 KB, patch)
2010-07-14 18:00 PDT, Matthew Delaney
no flags Details | Formatted Diff | Diff
Patch (10.19 KB, patch)
2010-07-16 13:01 PDT, Matthew Delaney
oliver: review+
Details | Formatted Diff | Diff
Previous + Cairo fix (10.19 KB, patch)
2010-07-16 14:21 PDT, Matthew Delaney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Delaney 2010-07-13 13:25:12 PDT
Safari is failing 2d.path.stroke.prune.arc
Comment 1 Matthew Delaney 2010-07-14 14:27:06 PDT
Created attachment 61566 [details]
Patch
Comment 2 Darin Adler 2010-07-14 15:25:59 PDT
Comment on attachment 61566 [details]
Patch

> +    if ((p1 == m_path.currentPoint()) || (p1 == p2) || !r)

No need for the extra parentheses here since == binds more tightly than || and it's customary to not include these.

> Index: WebCore/platform/graphics/cg/PathCG.cpp
> ===================================================================
> --- WebCore/platform/graphics/cg/PathCG.cpp	(revision 63275)
> +++ WebCore/platform/graphics/cg/PathCG.cpp	(working copy)
> @@ -249,6 +249,11 @@ bool Path::hasCurrentPoint() const
>  {
>      return !isEmpty();
>  }
> +    
> +FloatPoint Path::currentPoint() const 
> +{
> +    return CGPathGetCurrentPoint(m_path);
> +}

I believe adding this for CG only will break the build for all platforms that don’t use CG. That’s probably why the EWS failed on Qt. So you’ll need to add this for other platforms as well.

review- because we need this to at least compile on the non-CG platforms
Comment 3 WebKit Review Bot 2010-07-14 15:50:30 PDT
Attachment 61566 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/3447295
Comment 4 Matthew Delaney 2010-07-14 17:42:29 PDT
Created attachment 61589 [details]
Patch
Comment 5 Darin Adler 2010-07-14 17:44:14 PDT
Comment on attachment 61589 [details]
Patch

> +FloatPoint Path::currentPoint() const 
> +{
> +    // FIXME: implement safe way to return current point of subpath.
> +    return 0;
> +}

I don’t think this will compile. There’s no way to convert the number 0 into a FloatPoint. You probably need to return something like FloatPoint(NAN, NAN). You should test by actually compiling the code, perhaps in PathCG.cpp.

Not sure what "safe" means in the comment.
Comment 6 Matthew Delaney 2010-07-14 18:00:06 PDT
Created attachment 61592 [details]
Patch
Comment 7 Darin Adler 2010-07-14 18:10:58 PDT
Comment on attachment 61592 [details]
Patch

Come to think of it, I’m not sure NAN works on all the platforms. We might need to use "numeric_limits<float>::quiet_NaN()" instead. The reason I suggested NAN is that is safe. The optimization won't do any harm if you return a point that can never be equal.
Comment 8 Andreas Kling 2010-07-14 18:59:55 PDT
Good stuff :-)

The Qt implementation of Path::currentPoint() would be:

FloatPoint Path::currentPoint() const 
{
    return m_path.currentPosition();
}
Comment 9 Sam Weinig 2010-07-15 22:36:57 PDT
The cairo equivelent is probably.

FloatPoint Path::currentPoint() const 
{
    double x;
    double y;
    cairo_get_current_point(platformPath()->m_cr, x, y)
    return FloatPoint(x, y);
}
Comment 10 Matthew Delaney 2010-07-16 13:01:26 PDT
Created attachment 61839 [details]
Patch
Comment 11 Oliver Hunt 2010-07-16 13:28:00 PDT
Comment on attachment 61839 [details]
Patch

r=me
Comment 12 WebKit Review Bot 2010-07-16 14:08:12 PDT
Attachment 61839 [details] did not build on gtk:
Build output: http://webkit-commit-queue.appspot.com/results/3396494
Comment 13 Matthew Delaney 2010-07-16 14:21:55 PDT
Created attachment 61847 [details]
Previous + Cairo fix

Ooops on the Cairo impl slip. This should be good. I checked their code use below to double/triple check.
Comment 14 WebKit Commit Bot 2010-07-16 17:08:49 PDT
Comment on attachment 61847 [details]
Previous + Cairo fix

Clearing flags on attachment: 61847

Committed r63599: <http://trac.webkit.org/changeset/63599>
Comment 15 WebKit Commit Bot 2010-07-16 17:08:55 PDT
All reviewed patches have been landed.  Closing bug.