Fail to prune Zero-length line segments before stroking a path |
||||||
Issue descriptionExample 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:
,
Sep 5 2016
,
Sep 5 2016
,
Sep 21 2016
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.
,
Sep 21 2016
And what does the spec have to say about this?
,
Sep 22 2016
The spec I think would be https://html.spec.whatwg.org/multipage/scripting.html#trace-a-path (step 2) https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-arcto could also be relevant.
,
Sep 26 2016
Skia has a mode to remove the empty subpaths. I wrote it. I'll try to sort this out.
,
Sep 26 2016
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.
,
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.
,
Sep 26 2016
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.
,
Sep 26 2016
Firefox also fails.
,
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.
,
Sep 26 2016
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?
,
Sep 26 2016
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.
,
Sep 21
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by xfzhang...@gmail.com
, Sep 5 201623.0 KB
23.0 KB View Download