New issue
Advanced search Search tips

Issue 784049 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

scaling (with css) an svg which is animated (with css) produces pixelated output

Reported by geop...@gmail.com, Nov 11 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Open that attached page
2. Click on the button

What is the expected behavior?
After clicking on the button, the top (rotating) image should have the same size as the bottom one (it does) and it should be as clean and sharp as the bottom one (it does not).

What went wrong?
The rendered svg looks very pixelated. It seems that chrome rasterizes the svg when the document is loaded and it then keeps using the same initial low-res rasterization even when the image gets resized (by changing the scale in the css transform).

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 62.0.3202.75  Channel: stable
OS Version: 
Flash Version:
 
index.html
1.2 KB View Download

Comment 1 by woxxom@gmail.com, Nov 11 2017

Bisect info: 423612 (good) - 423624 (bad)
https://chromium.googlesource.com/chromium/src/+log/e227f145..644643a2?pretty=fuller
Suspecting r423624 = 644643a2e8d9a5a0acda7dfa8c6b3e2bddfeec9c = https://crrev.com/2397903002
"cc: Handle more cases in TransformOperations::ScaleComponent"
Landed in 55.0.2883.0

Comment 2 by kochi@chromium.org, Nov 13 2017

Components: -Blink Internals>Compositing>Animation
Owner: ajuma@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks woxxom for bisecting!

ajuma@ could you see if this is a relevant issue with the CL?

Comment 3 by ajuma@chromium.org, Nov 15 2017

Cc: chrishtr@chromium.org vmp...@chromium.org enne@chromium.org
We don't recompute raster scale during a CSS animation. The animated image starts out which scale 0.1 and scale doesn't change during the animation, so we compute that its max scale during the animation is 0.1, and raster it at the scale. But clicking on the button changes the scale on the container div to 1, so the new ideal scale for the image is 1.

Before the CL from #1, we didn't try to compute the maximum scale for animations that involved rotation, so we used scale 1 as a fallback.

Perhaps we should always raster with scale at least 1, no matter what maximum scale we compute for a CSS animation? That is, make sure that layers with CSS animations are rastered with at least the same scale we'd have used if they had a will-change:transform hint?

Comment 4 by ajuma@chromium.org, Nov 15 2017

Relatedly, adding will-change:transform to the ".image" class in the test case does workaround this bug.
Owner: vmp...@chromium.org
We are already doing that in the presence of will-change: transform.

https://chromium.googlesource.com/chromium/src/+/e17b1bcf1010c97436fadf6e58e9235b977c74ea

Sounds like we need to do this for css animations also. -> vmpstr for consideration.


Comment 6 by vmp...@chromium.org, Nov 15 2017

For css animations, afaik, we pick the maximum scale the element will be at throughout the animation. So, if we animate scale from 0.1 to 1.0 for example, then the animated element will be rasterized at scale 1.0. 

The problem in the testcase is that it's a combination of css transform and js updating the transform. I think the appropriate fix here is to actually have will-change:transform, since it's a hint that the transform of the element will change at some point on top of what css is doing. 

I don't think we should be rasterizing things at 1.0 at the minimum since it's likely to regress other css animations that keep their scale below 1.0 throughout the animation.

Comment 7 by vmp...@chromium.org, Nov 15 2017

Status: WontFix (was: Assigned)
After offline discussion with chrishtr@, we decided that this is a WontFix from Chromium's perpsective. The solution from the developer perspective is to add a will-change:transform hint that indicates to the browser that the transform for the element will change in some way that isn't readily detectable (ie js will change the transform). This will cause us to rasterize things at least at scale 1.0, avoiding the issue.

Please re-open if this solution is not feasible and we can discuss further.

Sign in to add a comment