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

Issue 667731 link

Starred by 15 users

Issue metadata

Status: Fixed
Owner:
not on Chrome anymore
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

WebGL canvas sometimes flickers black in Chrome app

Reported by a...@scirra.com, Nov 22 2016

Issue description

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

Steps to reproduce the problem:
Construct 2 users are reporting that in the context of a Chrome app (or extension window or whatever it's called now), the canvas sometimes flickers black. It seems to correlate with audio playback (so maybe some kind of thread timing issue?). In the Chrome browser itself, it appears it never happens - it only occurs when loaded as a Chrome app.

HTML version which does *not* reproduce the issue: https://www.scirra.com/labs/bugs/flickerbughtml/

Identical version wrapped as a Chrome app which does reproduce the issue: attached to this report.

The issue is sporadic and sometimes you have to wait or try a few times.

What is the expected behavior?
The canvas should never flicker and always render, like it does in the HTML version.

What went wrong?
Occasionally the screen flickers black, which is distracting for games.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

This was originally reported by Construct 2 users here: https://www.scirra.com/forum/screen-flickers_t183744
where several users say they were able to reproduce it. One user provided a video of the issue affecting their game: https://www.youtube.com/watch?v=m7hQElQKO0M
 
flickerbugcr.zip
1.0 MB Download

Comment 1 by a...@scirra.com, Nov 22 2016

I'd also add this affects Chromium-based frameworks like NW.js, which increases the impact to users.
Components: -Blink>Canvas Platform>Extensions
The fact that HTML version works fine and the extension has the problem, makes me feel that there is related to how extension works. Maybe resource loading?

Comment 3 by a...@scirra.com, Nov 22 2016

They are pretty much identical in terms of resources/code. I think the key difference is it uses an extension window vs. browser tab.
Components: Blink>Canvas Blink>WebGL
Labels: -Pri-2 Needs-Triage-M54 M-54 Pri-1

Comment 5 by kbr@chromium.org, Nov 22 2016

Cc: jbau...@chromium.org
I can't immediately reproduce with any of:

Windows:
  54.0.2840.99 (Official Build) m (64-bit)
  57.0.2925.0 (Official Build) canary (64-bit)

macOS:
  57.0.2926.0 (Official Build) canary (64-bit)

Ashley, can you reproduce with Canary? Is closing and reopening the extension window sufficient to repro? How long does it usually take?

Also, on Windows, after pressing escape to take the fullscreen extension window back to windowed mode, I can never get it to go fullscreen in the same way again. Ashley, can you add a button or something to the app to support this?

CC'ing jbauman@ in case this is something related to surfaces on Windows since it seems to affect only full-screen mode.

You could check and see if it happens with the --disable-direct-composition command-line flag. 

Comment 7 by reeno...@gmail.com, Nov 22 2016

I just tested with the --disable-direct-composition flag and it fixes the issue. Can't see any screen flickering any more.

Could you tell or point to place where I can read about this option? What does it exactly do? Can we expect any performance drop or any other disadvantages while using this option?
There's no documentation of that, as it's not really intended to be a user-visible feature. Adding the flag disables the use of DirectComposition, which means that performance and power consumption will get a bit worse (maybe by 10%).

I can't seem to reproduce the issue on my Windows 10 machine on Canary. Could anyone who can reproduce this attach the contents of chrome://gpu from Chrome?

Comment 9 by reeno...@gmail.com, Nov 22 2016

Thanks for explanation. I tested it with my game and I see no performance drop so it is really not a big drop indeed.

I can reproduce the issue. I'm attaching the chrome://gpu report here.
gpu.html
203 KB View Download

Comment 10 by kbr@chromium.org, Nov 23 2016

Status: Available (was: Unconfirmed)
Hmm...presumably Optimus laptop, dual Intel HD 4000 and NVIDIA GeForce GT 635M GPUs.

Should we blacklist DirectComposition on Optimus configurations on Windows? These are no longer being made, correct?

Comment 11 by wen...@gmail.com, Nov 23 2016

I should add that the bug reproduce here only in fullscreen.

Comment 12 by wen...@gmail.com, Nov 23 2016

The bug reproduces easily on Thinkpad T460p with the attached Chrome app (similar to the one from OP).
gpu.html
101 KB View Download
Critical Screen Flickering Bug.zip
832 KB Download

Comment 13 by wen...@gmail.com, Nov 23 2016

The previous comment is with Canary and Win10

Comment 14 by wen...@gmail.com, Nov 23 2016

PS: OP's chrome app works well here, but the attachment in #12 doesn't.

Comment 15 by reeno...@gmail.com, Nov 23 2016

No I don't have an Optimus laptop. It's a Lenovo G780 Intel Core i7-3632QM + Intel HD 4000 and NVIDIA GeForce GT 635M GPUs.
With the version in comment #12 I can reproduce this with my intel-gpu-only laptop, so it's not related to optimus.
Labels: Needs-Feedback
Reporter@ - Could you please provide a sample URL in which the issue was reported.

This will help in triaging the issue further.

Thanks...!!
Cc: krajshree@chromium.org
Hi, ive encountered the same problem and this issue is currently holding us back from releasing our game. if i can be of any help or can provide needed information let me now. attached you find my system specs.
2ceda95b17c400fc59479f9661f414a6.png
9.1 KB View Download
71d1ff1bfe89514b0bcfee9c995886a7.png
16.9 KB View Download
78e644f3e33a202277e83eee8170fc1f.png
16.9 KB View Download
Cc: kbr@chromium.org jmad...@chromium.org
Labels: GPU-Intel
No one has reported any repros on NVIDIA or AMD at this point. Ken what GPU were you testing on in #5? Could be a tricky Intel bug.

Adding Intel label provisionally.
I have Nvidia and I have the bug 
Labels: -GPU-Intel
OK, scratch that. Might be some chrome/canvas specific issue then.
Also quentin.goinaud, can you upload a saved copy of Chrome's about:gpu on the affected machine?
As i also have NVIDIA this might help?



aboutgpu.txt
14.1 KB View Download
Looks like this may be a bug in DirectComposition in Windows. I can get it to flicker transparent even when I make the backbuffer opaque and then draw red  to the backbuffer immediately before swap every time. It's possible Chrome is temporarily hiding the backbuffer or window, but I think I've narrowed down most cases where that could happen and they don't seem to be causing this.
Owner: jbau...@chromium.org
Status: Started (was: Available)
I think there actually is a bug in Chrome, where setting the icon of the window because audio stops or starts causes the window to temporarily be marked as not visible (it's complicated).
Project Member

Comment 27 by bugdroid1@chromium.org, Nov 30 2016

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

commit b31f7c090c114097fc46ca120a3d0d221a238e88
Author: jbauman <jbauman@chromium.org>
Date: Wed Nov 30 09:58:29 2016

Disable redraw lock when using DirectComposition.

This can cause windows to flicker black when they're made invisible. It
should also be unnecessary, as WS_CLIPCHILDREN should prevent
DefWindowProc from modifying window contents in the area where Chrome is
rendering.

BUG= 667731 

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

[modify] https://crrev.com/b31f7c090c114097fc46ca120a3d0d221a238e88/ui/views/win/hwnd_message_handler.cc
[modify] https://crrev.com/b31f7c090c114097fc46ca120a3d0d221a238e88/ui/views/win/hwnd_message_handler.h

Labels: ReleaseBlock-Stable M-56
We can take this fix for M56.
Labels: Merge-Request-56
So far this seems stable enough for M56.

If people want a workaround before then, they could try making sure their app is always playing audio (at least when in fullscreen). I know that's terrible for performance/etc. but it should work.

Comment 30 by dimu@chromium.org, Dec 8 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 31 by bugdroid1@chromium.org, Dec 8 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5d94bf35db9e4bbf1fc7562992962bb651380521

commit 5d94bf35db9e4bbf1fc7562992962bb651380521
Author: John Bauman <jbauman@chromium.org>
Date: Thu Dec 08 02:22:15 2016

Disable redraw lock when using DirectComposition.

This can cause windows to flicker black when they're made invisible. It
should also be unnecessary, as WS_CLIPCHILDREN should prevent
DefWindowProc from modifying window contents in the area where Chrome is
rendering.

BUG= 667731 

Review-Url: https://codereview.chromium.org/2536983002
Cr-Commit-Position: refs/heads/master@{#435203}
(cherry picked from commit b31f7c090c114097fc46ca120a3d0d221a238e88)

Review URL: https://codereview.chromium.org/2562613002 .

Cr-Commit-Position: refs/branch-heads/2924@{#400}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/5d94bf35db9e4bbf1fc7562992962bb651380521/ui/views/win/hwnd_message_handler.cc
[modify] https://crrev.com/5d94bf35db9e4bbf1fc7562992962bb651380521/ui/views/win/hwnd_message_handler.h

Status: Fixed (was: Started)

Sign in to add a comment