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

Issue 631866 link

Starred by 5 users

Issue metadata

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



Sign in to add a comment

Garbage is displayed momentarily when exiting fullscreen video on Android

Project Member Reported by w...@chromium.org, Jul 27 2016

Issue description

When exiting fullscreen (on a video element) there's visible garbage displayed on some devices. This was on a N6. But it's also visible in debug builds as a blue background (The color that GlRenderer::ClearFramebuffer clears to). See attached screenrecording.

I think the root cause is our lack of synchronization between LTHI::set_has_transparent_background() in the browser compositor with frames from the renderer that have a transparent background.

When we enter fullscreen:
1) blink gives the page a transparent background and calls RenderWidgetCompositor::setHasTransparentBackground() which calls LTH::set_has_transparent_background()
2) we create a ContentVideoView which has the side effect of calling CompositorView::SetOverlayVideoMode(), which calls LTHI::set_has_transparent_background().
3) LTHI sets RenderPass::has_transparent_background based on this property
4) GLRenderer::ClearFrameBuffer checks the render pass background to decide whether to actually clear the framebuffer or not. If it's false, the framebuffer isn't cleared. (https://cs.chromium.org/chromium/src/cc/output/gl_renderer.cc?sq=package:chromium&dr=CSs&rcl=1469546500&l=437)

My theory is that when exiting fullscreen we render some frames that have a transparent bg after the LTHI background is reset to opaque. So we don't clear the framebuffer for a few frames and the transition looks bad.

It seems to me that the bg transparency should propagate with the compositor frame, and the browser compositor should set its own bg transparency based on that. That way we don't need to use the existence of ContentVideoView to signal it and everything is synchonized.
 
screenrecording.mp4
558 KB View Download

Comment 1 by w...@chromium.org, Aug 1 2016

Status: Untriaged (was: Available)
Cc: trchen@chromium.org
Labels: -Pri-3 M-54 ReleaseBlock-Stable Pri-1
Can we get this fixed for M54?  If this is consistently reproducible I think it's more impactful than a P3, esp. given the other internal reports.

Feel free to deprioritize if you disagree.

Comment 4 by w...@chromium.org, Aug 18 2016

Cc: siev...@chromium.org
Cc: kbr@chromium.org aelias@chromium.org piman@chromium.org
Components: Internals>GPU
Status: Available (was: Untriaged)
We shouldn't be showing garbage even if GlRenderer has not cleared.

Comment 6 by w...@chromium.org, Sep 1 2016

From what I remember, hardcoding GLRenderer to always clear fixed the issue.
Components: Blink>Fullscreen
Labels: -M-54 M-55
Owner: vmi...@chromium.org
Status: Assigned (was: Available)
I'm inclined to punt to 55 because it seems like a nonregression and to be device-specific (I can't repro on my Qualcomm Galaxy S7).

Victor, is there someone on your team with the cycles to work on this?

Comment 8 by kbr@chromium.org, Sep 1 2016

In my opinion this is a minor UI glitch and doesn't warrant P1.

Comment 9 by piman@chromium.org, Sep 1 2016

Cc: danakj@chromium.org
I believe we don't force-clear the onscreen surfaces at command buffer level, because this would have a performance cost on some devices, but only the browser (trusted) creates those, so there is no security aspect to it. So it's the browser compositor / UI's responsibility to fully cover the screen (or to clear).
On tilers there's often a higher performance cost to not clear.  I'll find someone to own this.
Because Swap discards (and hence why garbage shows up), it has the same performance effect as clearing on tilers.
Cc: vmi...@chromium.org
Owner: jbau...@chromium.org
Reassigning to jbauman@ after offline discussion.
Yeah, I think we should be doing SetContentsOpaque on the DelegatedFrameHostAndroid's layer based on has_transparent_background from the root render pass of the child surface.

We also need to figure out what background color the browser's compositor should have. It's currently set to white, which looks a bit odd in these transitions.

Comment 14 by w...@chromium.org, Sep 2 2016

Issue 643635 has been merged into this issue.
Project Member

Comment 15 by bugdroid1@chromium.org, Sep 8 2016

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

commit 862bef99a8b729f501689b0658f029464ff84135
Author: jbauman <jbauman@chromium.org>
Date: Thu Sep 08 00:32:47 2016

Set content opacity of DFHAndroid surfacelayer based on renderer frame contents.

The browser updates the overlay video mode flag before the renderer can
send a new frame. This means that when switching from fullscreen to
non-fullscreen the browser was expecting the renderer the fill the frame
completely and wasn't drawing the background, but it was accidentally
leaving part of the frame corrupted and uncleared.

BUG= 631866 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

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

[modify] https://crrev.com/862bef99a8b729f501689b0658f029464ff84135/content/browser/media/android/browser_media_player_manager.cc
[modify] https://crrev.com/862bef99a8b729f501689b0658f029464ff84135/content/browser/renderer_host/compositor_impl_android.cc
[modify] https://crrev.com/862bef99a8b729f501689b0658f029464ff84135/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/862bef99a8b729f501689b0658f029464ff84135/content/browser/renderer_host/render_widget_host_view_android.h
[modify] https://crrev.com/862bef99a8b729f501689b0658f029464ff84135/ui/android/delegated_frame_host_android.cc
[modify] https://crrev.com/862bef99a8b729f501689b0658f029464ff84135/ui/android/delegated_frame_host_android.h

Status: Fixed (was: Assigned)
Cc: fsam...@chromium.org

Sign in to add a comment