Issue metadata
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 descriptionUserAgent: 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.
,
Jul 12 2016
,
Jul 13 2016
Style looks like it's doing the right thing - this appears to be a paint/raster problem. Assigning to the paint team to triage.
,
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.
,
Jul 13 2016
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
,
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?
,
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.
,
Jul 14 2016
,
Jul 14 2016
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.
,
Sep 4 2016
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 |
|||||||||||||||||||||||||
Comment 1 by k...@luminance.org
, Jul 3 20162.4 MB
2.4 MB View Download