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

Issue 905548 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

SVG: Strange artifact when blending feGaussianBlur and feMorphology filters results

Reported by paul.leb...@gmail.com, Nov 15

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Example URL:
http://jsfiddle.net/xvzs85r1/

Steps to reproduce the problem:
<svg version="1.1" viewBox="0 0 24 24">
  <defs>
    <filter id="median">
      <feGaussianBlur stdDeviation="0.1"/>
      <feMorphology operator="erode" radius="0.2" result="erodedblur"/>
      <feBlend in="SourceGraphic" in2="erodedblur"/>
    </filter>
  </defs>

  <g filter="url(#median)">
    <polygon points="6,4 8,8 10,4 "/>
  </g>
</svg>

Try the above fiddle example, then resize your browser window.  When the window is small, rendering seems okay, but as you enlarge the window a strange artifact appears.  See attached image.

What is the expected behavior?

What went wrong?
Individually the filter components seem to work, but when you try to blend them together (eg with feBlend, feComposite, etc) you get this weird result where the morphology results seems corrupted with horizontal line gaps.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 70.0.3538.77  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Capture.PNG
4.1 KB View Download
Components: Blink>SVG
I can reproduce this (running Windows 7, same as the original poster) on current Chrome and on Canary (72.0.3610.2). However, this only seems to occur if hardware acceleration is enabled.
Components: Internals>GPU>Rasterization
Labels: Needs-Triage-M70
Components: -Blink>SVG
Cc: viswa.karala@chromium.org
Labels: -Type-Compat Triaged-ET Target-72 M-72 FoundIn-71 FoundIn-70 FoundIn-72 Type-Bug
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on chrome reported version# 70.0.3538.77, #70.0.3538.102 and on latest chrome# 72.0.3611.0 with sample URL provided in comment# 0 using Windows-10. As this issue is seen from M-60(60.0.3112.0), hence considering this issue as Non-Regression and marking it as Untriaged.
Note: Issue is not seen on Mac and Linux.

Thanks!
Cc: bsalomon@chromium.org
Labels: OS-Mac
Owner: hcm@google.com
Status: Assigned (was: Untriaged)
Suspecting a Skia issue - over to hcm@ for triage. Thanks!

Confirmed that this wasn't caused by tile boundaries, so guessing something internal to raster.
Cc: hcm@chromium.org
Labels: Hotlist-Ganesh
Owner: brianosman@google.com
Working through triage backlog- over to GPU wrangler for a look at this blur code in Ganesh.
Adding notes so I don't forget: This is a bug in the image filter logic. I've reproduced it, had some theories, and seen several suspicious things happening. I still can't articulate exactly what's broken, though.

The erode filter has a fast path when the width and height are both zero (which happens here), that causes it to just return a subset of the input, with the offset adjusted. At the time that this happens, we've applied the crop rect to the bounds that we use for the subset and offset, but that appears to double-transform/crop the result.

I have a "fix" that changes the fast-path case to simply return the input (and set the offset to the inputOffset). That works, but ignores the crop rect of the effect (if one is present).
... other notes: This fast path is in shared code, but only the GPU backend breaks. This may be due to the different implementation of makeSubset for GPU vs. raster-backed special images?
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 3

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

commit c32aeb326ebda95fb6090985b91dac44a6a2920b
Author: Brian Osman <brianosman@google.com>
Date: Mon Dec 03 16:46:29 2018

Fix two GPU image filters handling of subset inputs

Added a GM that demonstrates the bug. Should draw a blur with
the center masked out, and a circular blurry shape that's
roughly the inverse. On raster, this was already the result.
On GPU, the blurred/eroded layer becomes a subset with an
origin other than (0,0), and that layer was shifted.

I *think* this is the correct fix - we are including 'offset'
in the texture matrices, but that's just based on the crop
rects and adjustments from each filter. We still need to adjust
the texture coords for the subsets themselves.

Bug:  chromium:905548 
Change-Id: I19c936adad90311aef243a9395a270d2e015df2f
Reviewed-on: https://skia-review.googlesource.com/c/173321
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>

[modify] https://crrev.com/c32aeb326ebda95fb6090985b91dac44a6a2920b/gn/gm.gni
[add] https://crrev.com/c32aeb326ebda95fb6090985b91dac44a6a2920b/gm/crbug_905548.cpp
[modify] https://crrev.com/c32aeb326ebda95fb6090985b91dac44a6a2920b/src/effects/imagefilters/SkArithmeticImageFilter.cpp
[modify] https://crrev.com/c32aeb326ebda95fb6090985b91dac44a6a2920b/src/effects/imagefilters/SkXfermodeImageFilter.cpp

Status: Fixed (was: Assigned)
Project Member

Comment 13 by bugdroid1@chromium.org, Dec 3

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

commit 914caad096fcde63a73737dbee3ecb42cbf1d575
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Mon Dec 03 19:24:42 2018

Roll src/third_party/skia b13658891bbd..45723ac93149 (5 commits)

https://skia.googlesource.com/skia.git/+log/b13658891bbd..45723ac93149


git log b13658891bbd..45723ac93149 --date=short --no-merges --format='%ad %ae %s'
2018-12-03 egdaniel@google.com Take into accout the GrBackendFormat when deciding if we can chain textures together.
2018-12-03 reed@google.com update docs for MakeFromString and SkTextEncoding
2018-12-03 brianosman@google.com Fix two GPU image filters handling of subset inputs
2018-12-03 egdaniel@google.com Reland "Add support for Ycbcr Conversion Samplers in vulkan."
2018-12-03 reed@google.com flag to convert to SkTextEncoding


Created with:
  gclient setdep -r src/third_party/skia@45723ac93149

The AutoRoll server is located here: https://autoroll.skia.org/r/skia-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.

CQ_INCLUDE_TRYBOTS=luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux-blink-rel;luci.chromium.try:linux-chromeos-compile-dbg;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel

BUG= chromium:905548 
TBR=jcgregorio@chromium.org

Change-Id: Ib31eec67290dbff8f2a826b06a7d825bf21a68d0
Reviewed-on: https://chromium-review.googlesource.com/c/1358757
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#613190}
[modify] https://crrev.com/914caad096fcde63a73737dbee3ecb42cbf1d575/DEPS

Sign in to add a comment