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

Issue 636628 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Aug 2016
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 636630



Sign in to add a comment

Android: Previous tab's frontbuffer is not freed when tab switching

Project Member Reported by siev...@chromium.org, Aug 11 2016

Issue description

There is a regression from the combination of these two patches:

https://codereview.chromium.org/2021003002/
https://codereview.chromium.org/1732323002/

We trigger a readback when switching away from a tab.

Because of the lock, if the readback doesn't complete, then the tiles for the last frame of the previous tab won't be freed. Also, because of a throttle it will break other readbacks and can prevent gathering placeholders for glitch-free tab switching.

The frontend code detaches the old SurfaceLayer when switching to the new tab. Regardless of how we issue the copy output request, the SurfaceAggregator will not fulfill it (since it's not on the root Surface) if the SurfaceLayer for the tab is detached.

 
Blocking: 636630

Comment 2 Deleted

Comment 3 by gov...@chromium.org, Aug 11 2016

Labels: OS-Android
Seems like this is specific to Android.
Cc: -amineer@chromium.org
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 12 2016

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

commit 02d8a97db2cf9fdca8042ce72416db6b5fc2abbc
Author: sievers <sievers@chromium.org>
Date: Fri Aug 12 01:06:49 2016

Android: Attach hidden layer for CopyFromCompositingSurface()

When the RenderWidgetHostView becomes invisible we might tear down
the layer, which removes the impl layer from the impl layer,
which will cause the Surface not to be added as a dependant Surface
of the root Surface.

Make sure readbacks actually complete (as long as the display is
drawing) by attaching a hidden layer for the readback Surface.

BUG= 636628 
TBR=dtrainor@chromium.org

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

[modify] https://crrev.com/02d8a97db2cf9fdca8042ce72416db6b5fc2abbc/content/browser/renderer_host/compositor_impl_android.cc
[modify] https://crrev.com/02d8a97db2cf9fdca8042ce72416db6b5fc2abbc/content/browser/renderer_host/compositor_impl_android.h
[modify] https://crrev.com/02d8a97db2cf9fdca8042ce72416db6b5fc2abbc/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/02d8a97db2cf9fdca8042ce72416db6b5fc2abbc/content/browser/renderer_host/render_widget_host_view_android.h
[modify] https://crrev.com/02d8a97db2cf9fdca8042ce72416db6b5fc2abbc/ui/android/window_android_compositor.h

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 12 2016

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

commit 9df27b364447148d91e8afe8589ab0914fbb3688
Author: sievers <sievers@chromium.org>
Date: Fri Aug 12 02:21:37 2016

Android: Don't hold frame lock during readback

The problem with this is that it might keep the browser-side
tiles from ever getting freed if for some reason the copy output
request does not finish. And currently there are no such
guarantees for example if the app goes to the background and we don't
have a context and cannot composite.

Also, it would cause jank since the lock keeps from submitting new
frames from the renderer.

As far as readback requests are concerned, this would not cause
the readback to be dropped even if we destroyed the Surface since
it's garbage-collected and there should still be a GC root through
the parent Surface and the hidden layer we attach until the readback
is completed.

Remove more of this logic and public API in a follow-up.

BUG= 636628 

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

[modify] https://crrev.com/9df27b364447148d91e8afe8589ab0914fbb3688/content/browser/renderer_host/render_widget_host_view_android.cc

Status: Fixed (was: Assigned)
Labels: Merge-Request-53

Comment 9 by dimu@chromium.org, Aug 15 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 15 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6837f6960cc65cdf821f1985f68e01240187724

commit d6837f6960cc65cdf821f1985f68e01240187724
Author: Daniel Sievers <sievers@chromium.org>
Date: Mon Aug 15 18:42:41 2016

Android: Attach hidden layer for CopyFromCompositingSurface()

When the RenderWidgetHostView becomes invisible we might tear down
the layer, which removes the impl layer from the impl layer,
which will cause the Surface not to be added as a dependant Surface
of the root Surface.

Make sure readbacks actually complete (as long as the display is
drawing) by attaching a hidden layer for the readback Surface.

BUG= 636628 , 574537 
TBR=dtrainor@chromium.org

Review-Url: https://codereview.chromium.org/2243663002
Cr-Commit-Position: refs/heads/master@{#411502}
(cherry picked from commit 02d8a97db2cf9fdca8042ce72416db6b5fc2abbc)

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

Cr-Commit-Position: refs/branch-heads/2785@{#599}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/d6837f6960cc65cdf821f1985f68e01240187724/content/browser/renderer_host/compositor_impl_android.cc
[modify] https://crrev.com/d6837f6960cc65cdf821f1985f68e01240187724/content/browser/renderer_host/compositor_impl_android.h
[modify] https://crrev.com/d6837f6960cc65cdf821f1985f68e01240187724/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/d6837f6960cc65cdf821f1985f68e01240187724/content/browser/renderer_host/render_widget_host_view_android.h
[modify] https://crrev.com/d6837f6960cc65cdf821f1985f68e01240187724/ui/android/window_android_compositor.h

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 15 2016

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

commit ba6da7852ca0d9ef7708f23a8b7c0fd1f93c2cd8
Author: Daniel Sievers <sievers@chromium.org>
Date: Mon Aug 15 18:49:26 2016

Android: Don't hold frame lock during readback

The problem with this is that it might keep the browser-side
tiles from ever getting freed if for some reason the copy output
request does not finish. And currently there are no such
guarantees for example if the app goes to the background and we don't
have a context and cannot composite.

Also, it would cause jank since the lock keeps from submitting new
frames from the renderer.

As far as readback requests are concerned, this would not cause
the readback to be dropped even if we destroyed the Surface since
it's garbage-collected and there should still be a GC root through
the parent Surface and the hidden layer we attach until the readback
is completed.

Remove more of this logic and public API in a follow-up.

BUG= 636628 

Review-Url: https://codereview.chromium.org/2241633002
Cr-Commit-Position: refs/heads/master@{#411523}
(cherry picked from commit 9df27b364447148d91e8afe8589ab0914fbb3688)

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

Cr-Commit-Position: refs/branch-heads/2785@{#600}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/ba6da7852ca0d9ef7708f23a8b7c0fd1f93c2cd8/content/browser/renderer_host/render_widget_host_view_android.cc

Sign in to add a comment