New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 644067 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat



Sign in to add a comment

Fail to prune Zero-length line segments before stroking a path

Project Member Reported by xfzhang...@gmail.com, Sep 5 2016

Issue description

Example URL:
http://wts.crosswalk-project.org/tests/canvas/w3c/2d.path.stroke.prune.arc.html

Steps to reproduce the problem:
Just open the link http://wts.crosswalk-project.org/tests/canvas/w3c/2d.path.stroke.prune.arc.html in Chromium 52 and any previous version

What is the expected behavior?
Zero-length line segments must be pruned before stroking a path

What went wrong?
Fail to prune Zero-length line segments before stroking a path

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? Yes Before Chromium 52

Does this work in other browsers? N/A 

Chrome version: 52.0.2720.0  Channel: stable
OS Version: 5.0
Flash Version:
 
pass.png
13.5 KB View Download
fail.png
23.0 KB View Download

Comment 2 by leon....@intel.com, Sep 5 2016

Components: Blink

Comment 3 by tkent@chromium.org, Sep 5 2016

Components: -Blink Blink>Canvas
The issue here is possibly related to the need to keep zero length paths for SVG because correct drawing of markers and linecaps requires it.
And what does the spec have to say about this?
Owner: schenney@chromium.org
Status: Assigned (was: Unconfirmed)
Skia has a mode to remove the empty subpaths. I wrote it. I'll try to sort this out.
Cc: caryclark@chromium.org fmalita@chromium.org reed@chromium.org
Components: Internals>Skia
Treatment of degenerate path segments for Chrome once again bites us.

Apparently SVG and Canvas differ on the way you should treat degenerate content. Canvas says remove degenerate segments when stroking, while SVG insists you keep them.

I think this means we need a way to tell the stroking code which option to do, and hence what to tell the path iterator as it spits out segments. Would the Skia team be willing to get the Skia side in place?

I have verified that we fix this test if we change, for instance, SkEdgeBuilder to remove degenerates as it processes a path. But that will break a whole host of other content, I presume.

Comment 9 by f...@opera.com, Sep 26 2016

Another option might be to check what compat looks like for this case, and adjust the spec if there's indication of it deviating from implementations.
The history of this is that, way back when, I changed Skia to keep the degenerate segments because we were failing all the tests for painting zero-line-length markers and line caps. I agree that it would be nice if the specs all agreed on what to do.
Firefox also fails.

Comment 12 by f...@opera.com, Sep 26 2016

Probably need to sample Gecko on other platforms too, because I believe it uses Skia too on at least some of them.
There's already a path iterator and a raw path iterator. Does this require a third iterator? Can SVG's need be built on top of the raw path iterator?
Right, we already have raw path iteration and that was used by SVG for markers and/or endcaps. I'm not sure if it still is.

The issue here, though, is that the Skia internal path stroking code does not remove degenerates, at least as far as I can tell, and the Canvas spec implementation is using that code directly. i.e. via something like SkCanvas::drawPath with a stroke paint. I really don't think Skia should change the default behavior here - the effect would be significant. I'm thinking that maybe we can make the behavior optional and keep it efficient.

I'll make a first pass at looking into what would need to change, and also figure out the extent to which other vendors agree with us.
Cc: -reed@chromium.org fs...@chromium.org schenney@chromium.org
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment