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

Issue 625114 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 521364
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Css transitions cause visual glitches as quality of layers changes rapidly

Reported by k...@luminance.org, Jul 1 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0

Example URL:
http://game.granbluefantasy.jp/

Steps to reproduce the problem:
When CSS animations or transitions are playing in layers on top of the game's rendering canvas, this bug reproduces fairly often. It usually occurs for 1-2 frames. The rendering canvas is used to render the player in co-op rooms (clip attached) and during battle scenes. The game will animate/transition elements over battle scenes fairly often so you should see the glitch.

This may also only happen when playing on a high DPI monitor or with the game set to a larger size (it uses css zoom to adjust size); I am not sure.

What is the expected behavior?
Layers' appearance should remain relatively constant, and layers that are not transitioning/animating should look exactly the same

What went wrong?
When a layer transitions/animates it can glitch between an unfiltered (i.e. nearest-neighbor) and filtered (i.e. linear) state. This causes a visible 'snap' as the coordinates get clamped. Layers under the transitioning/animating layer also tend to glitch and lose filtering temporarily.

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.103  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0

sidebar.mp4 shows an opaque div with a background-image and a child element. The div's opacity is set to 0.7 and it has css transitions enabled for the 'opacity' property. A :hover style sets the opacity to 1.0, causing the transition and visible 'glitch' you see in the video.

filtering cropped.mp4 is a recording of a co-op room in the game. I trigger the fly-out menu (from my chrome extension), which is an opaque div containing <ul>s, to pop out over the co-op room and then mouse around to open and close submenus. The div and submenus have css transitions applied for opacity and position; the opacity and position shift between 0/-n and 1/0 respectively. In this case the canvas layer containing the player character visibly glitches and loses its smoothing.

It is unfortunately somewhat difficult to test this, but making an account for the game is free and both test scenarios should be reproducible without playing much of it. The icon opacity one is trivial to reproduce by installing my extension, but it might not be the exact same bug.
 
filtering cropped.mp4
3.2 MB View Download
sidebar.mp4
1.2 MB View Download

Comment 1 by k...@luminance.org, Jul 3 2016

Here is a more dramatic example. Mousing between the two icons on the left (which have a CSS transition enabled for opacity) causes dramatic visible jittering and glitches as the compositor does... whatever it is it's doing.

Most of the elements glitching out do not have transforms applied to them.
sidebar combat.mp4
2.4 MB View Download
Components: -Internals>Media Blink>CSS
Components: -Blink>CSS Blink>Paint
Style looks like it's doing the right thing - this appears to be a paint/raster problem. Assigning to the paint team to triage.

Comment 4 by k...@luminance.org, Jul 13 2016

Incidentally, in that most recent example I was able to mitigate the glitching by splitting each set of elements into its own containing box. I had to also make sure they were all laid out with position:absolute (not relative) and set an explicit line-height on all the text. That resulted in most of the boxes and text elements being laid out at integral coordinates without blurring or jittering.

The icons near the bottom with the transitions still exhibit compositor issues, though, as do the existing parts of the game you can see bounce between filtered/unfiltered in the clip.

So it seems like a bunch of things can cause a group of elements to get put into some sort of compositor group here, and then everything in that group suffers from quality issues during transitions/animations.
Cc: trchen@chromium.org
Components: -Blink>Paint Internals>Compositing Blink>Compositing
Status: Available (was: Unconfirmed)
This is a known issue with subpixel layer positioning. You're seeing it because opacity is a trigger for compositing. You can probably work around it by always setting opacity less than 1.

I think this is basically a duplicate of https://bugs.chromium.org/p/chromium/issues/detail?id=521364

Comment 6 by k...@luminance.org, Jul 13 2016

Why is it blurry if all the offsets are integral? According to the computed layout in the dev tools, and my stylesheets, everything is at integer positions. Is it because I'm on a high-DPI panel and that's causing Chrome to do the wrong thing here?

Comment 7 by k...@luminance.org, Jul 13 2016

For a specific example:
The tiny icon labelled with a '52' is an absolutely-positioned box contained within another absolutely-positioned box. Neither of them have any transforms or opacity values applied. The '52' icon has an :after element containing the number and an rgba background color to dim the icon.

If I remove the rgba background color and apply an opacity value to the icon, the icon and everything else in the containing box (see the meters above it) all become blurry. This is despite the fact that all the offsets are integer values, as are the sizes of the boxes and the font sizes and line heights.

I can't imagine why subpixel coordinates would come into play here. All the coordinates are integers. Furthermore, the positioning of the background images (if you look closely at the icon) gets messed up on the Y axis when compositing is turned on, which seems like it absolutely is a bug.
Screenshot 2016-07-13 16.42.32.png
93.4 KB View Download
Owner: chrishtr@chromium.org
Status: Assigned (was: Available)

Comment 9 by trchen@chromium.org, Jul 14 2016

Mergedinto: 521364
Status: Duplicate (was: Assigned)
I think it is a dupe of 521364. Layout is snapped to CSS pixel, but CSS pixel may not always align with device pixels. A few win10 tablets shipped with default 150% device scale. The blurriness is due to layers that are aligned to even pixels getting squashed into a layer that's aligned to odd pixel.

To kg@: Your intuition is very accurate: "it seems like a bunch of things can cause a group of elements to get put into some sort of compositor group here". It is an optimization called layer squashing in Chrome.

While the blurry text issue remains, the 'bouncing between filtered and unfiltered for composited layers' issue (as seen on the health bar in Comment 1) does seem to be fixed in Chrome 53.

Sign in to add a comment