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

Issue 605439 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

<canvas> bezier drawing glitches

Project Member Reported by deanm@chromium.org, Apr 21 2016

Issue description

Version: 49.0.2623.112 (64-bit)
OS: OS X 10.9.5

Not sure when this regressed.  This is an old <canvas> 3d experiment, and I just noticed that the rendering now is quite glitchy and bad.  I know that the code probably produces some tricky control points.

http://deanm.github.io/pre3d/demos/loader.html#slink.js


 
Screen Shot 2016-04-21 at 10.38.25.png
174 KB View Download
Using hardware accelerated shows the glitches, software rendering doesn't  have the problem.

Problem can be observed under linux as well.

Comment 2 by reed@google.com, Apr 21 2016

Cc: -reed@chromium.org bsalo...@google.com caryclark@google.com reed@google.com
Cc: jvanverth@chromium.org

Comment 4 by bsalo...@google.com, Apr 21 2016

Cc: egdaniel@chromium.org
Did bisect, seems to point to this skia deps roll:
https://chromium.googlesource.com/skia/+log/119468b..3538e3b

Comment 6 by bsalo...@google.com, Apr 21 2016

Owner: jvanverth@chromium.org
This seems like the most likely candidate:

876f48b Adjust tolerance to fix GPU hairline curve issues by jvanverth · 12 months ago
Labels: OS-Linux
Yes, that appears to be it. Odd that it doesn't happen with Windows.
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 29 2016

The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/45a6f49ef9ff276e08025d0d2ba6a821a96d3f34

commit 45a6f49ef9ff276e08025d0d2ba6a821a96d3f34
Author: xidachen <xidachen@chromium.org>
Date: Fri Apr 29 01:25:25 2016

Adjust tolerance to fix bezier glitches issue

In a previous CL: https://codereview.chromium.org/1126793003, the value
of gDegenerateToLineTol was changed from 1.0 to 0.25 which caused the
bezier glitches.

This CL changes the value to SK_ScalarRoot2Over2, with this change the
bezier curve looks fine, and the result of the layout tests pointed out
in this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=472847
is also reasonable.

BUG=605439
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1926063002

Review-Url: https://codereview.chromium.org/1926063002

[modify] https://crrev.com/45a6f49ef9ff276e08025d0d2ba6a821a96d3f34/src/gpu/batches/GrAAHairLinePathRenderer.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Apr 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2d4560e2c716abd26f3476ff92056d1f1f5f8f02

commit 2d4560e2c716abd26f3476ff92056d1f1f5f8f02
Author: skia-deps-roller <skia-deps-roller@chromium.org>
Date: Fri Apr 29 02:44:13 2016

Roll src/third_party/skia/ 4df1656f0..45a6f49ef (1 commit).

https://chromium.googlesource.com/skia.git/+log/4df1656f0f72..45a6f49ef9ff

$ git log 4df1656f0..45a6f49ef --date=short --no-merges --format='%ad %ae %s'
2016-04-28 xidachen Adjust tolerance to fix bezier glitches issue

BUG=605439

CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
TBR=stephana@google.com

Review-Url: https://codereview.chromium.org/1931183002
Cr-Commit-Position: refs/heads/master@{#390580}

[modify] https://crrev.com/2d4560e2c716abd26f3476ff92056d1f1f5f8f02/DEPS

Comment 10 Deleted

Status: Fixed (was: Available)
Project Member

Comment 12 by bugdroid1@chromium.org, Apr 29 2016

The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/cfeb85fa6a2fcebc0c54f08f313058bae7258e63

commit cfeb85fa6a2fcebc0c54f08f313058bae7258e63
Author: jvanverth <jvanverth@google.com>
Date: Fri Apr 29 14:38:10 2016

Revert of Adjust tolerance to fix bezier glitches issue (patchset #1 id:1 of https://codereview.chromium.org/1926063002/ )

Reason for revert:
This is causing undesirable image failures in a large number of Skia GMs.

Original issue's description:
> Adjust tolerance to fix bezier glitches issue
>
> In a previous CL: https://codereview.chromium.org/1126793003, the value
> of gDegenerateToLineTol was changed from 1.0 to 0.25 which caused the
> bezier glitches.
>
> This CL changes the value to SK_ScalarRoot2Over2, with this change the
> bezier curve looks fine, and the result of the layout tests pointed out
> in this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=472847
> is also reasonable.
>
> BUG=605439
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1926063002
>
> Committed: https://skia.googlesource.com/skia/+/45a6f49ef9ff276e08025d0d2ba6a821a96d3f34

TBR=robertphillips@google.com,xidachen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=605439

Review-Url: https://codereview.chromium.org/1933733002

[modify] https://crrev.com/cfeb85fa6a2fcebc0c54f08f313058bae7258e63/src/gpu/batches/GrAAHairLinePathRenderer.cpp

Status: Assigned (was: Fixed)
I don't think changing the tolerance is the correct fix. The artifacts seen are probably due to errors in the GPU quadratic curve rendering algorithm -- if a quad has high curvature the calculation of the distance to the curve (which is used to figure out whether to turn a pixel on or off) breaks down at the point of high curvature. For quadratics that are given to Skia, these are chopped at points of high curvature. For those generated from cubics, we don't do that chop. 
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/938475d078e1326dc517c4202e58531886ac777f

commit 938475d078e1326dc517c4202e58531886ac777f
Author: skia-deps-roller <skia-deps-roller@chromium.org>
Date: Fri Apr 29 20:49:36 2016

Roll src/third_party/skia/ 219ac2bc0..817fed3cb (16 commits).

https://chromium.googlesource.com/skia.git/+log/219ac2bc091d..817fed3cb7d8

$ git log 219ac2bc0..817fed3cb --date=short --no-merges --format='%ad %ae %s'
2016-04-29 benjaminwagner Revert of Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRender… (patchset #5 id:80001 of https://codereview.chromium.org/1924183003/ )
2016-04-29 msarett Revert of Introduce SkGammas type to represent ICC gamma curves (patchset #7 id:40002 of https://codereview.chromium.org/1928123002/ )
2016-04-29 msarett Introduce SkGammas type to represent ICC gamma curves
2016-04-29 liyuqian Fix Vulkan Build in Android
2016-04-29 jvanverth Don't mark mipmaps dirty if uploading > 1 levels
2016-04-29 msarett Add ColorCodecSrc for testing/comparison on color corrected decodes
2016-04-29 mtklein remove SkWriteBuffer::reserve()
2016-04-29 bsalomon Use constexpr constructors of GrStencilSettings rather than hacky macro system.
2016-04-29 bungeman Remove skstd::is_function.
2016-04-29 djsollen Require Android SDK copy of CMake to build Vulkan on Android. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930423002
2016-04-29 jvanverth Revert of Adjust tolerance to fix bezier glitches issue (patchset #1 id:1 of https://codereview.chromium.org/1926063002/ )
2016-04-29 bungeman Update running Chromium trybots on Skia CLs docs.
2016-04-29 bsalomon Unify implementations of stroking radius calculationsns GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1928133002
2016-04-29 robertphillips Add sk_sp to SkSurface_Gpu and SkGpuDevice
2016-04-29 djsollen Repurpose Release_Developer BUILDTYPE and remove SK_DEVELOPER.
2016-04-29 kkinnunen Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRenderTarget

BUG=605439

CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
TBR=stephana@google.com

Review-Url: https://codereview.chromium.org/1925393003
Cr-Commit-Position: refs/heads/master@{#390750}

[modify] https://crrev.com/938475d078e1326dc517c4202e58531886ac777f/DEPS

Labels: OS-Windows
It also happens on Win 10.

Comment 17 by fs...@chromium.org, Jun 29 2018

Components: -Blink>Canvas Internals>Skia
I believe this issue is affecting us pretty badly. See, for example, the following visualisation, where the entire browser window is corrupted, extending well outside the SVG element:

https://netograph.io/datasets/trajectories/I8-y2bsfU6Gx01fBTv6y4Q
Cc: csmartdalton@google.com
Added csmartdalton@. Chris, do you think any of your CCPR or related work would help with this?
Cc: -csmartdalton@google.com -jvanverth@chromium.org jvanverth@google.com
Owner: csmartdalton@google.com
I would expect CCPR stroking to fix these artifacts. We use it instead of the GrAAHairlinePathRenderer specifically to fix artifacts like these.

However, it requires ES 3.0 functionality. When can canvas2d have ES 3? Or will it use oopr soon?
Cc: fs...@chromium.org

Sign in to add a comment