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

Issue 638068 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
inactive
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Black flickers on tab switcher thumbnails

Project Member Reported by aelias@chromium.org, Aug 16 2016

Issue description

Attached video on Nexus 5, 52.0.2743.98, and screenshot of the frame from the video.

Observations:
1. Easily reproducible with 10+ tabs.
2. Consistently affects some "bad" subset of the thumbnail screenshots.  When there is only one live tab, the flickering tab is usually the tab right above it.
3. The flicker is entirely black and affects the thumbnail itself.
4. There are several special y-axis thresholds on the screen that cause all "bad" tabs to flicker black at once.  The flicker only ever happens scrolling the tabs up, not down.  The flicker always lasts exactly one frame (or maybe exactly two) and it seems impossible to hold in place the black frame.
 
tabflicker.mp4
5.8 MB View Download
tabflickerfreezeframe.png
347 KB View Download

Comment 1 by aelias@chromium.org, Aug 16 2016

The magic thresholds are when one of the tab thumbnails further back is almost fully hidden (at least by the dropshadow).  That's why it's only reproducible when there's lots of tabs.

I suspect an optimization to remove a hidden tab from the layer tree is having a bad side effect.

Comment 2 by aelias@chromium.org, Aug 18 2016

I have a fix up for review at https://codereview.chromium.org/2253423003
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 19 2016

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

commit f859be05a8db1f6301119cd9dfd58d7ddd75ee22
Author: aelias <aelias@chromium.org>
Date: Fri Aug 19 21:29:13 2016

Make TabLayer recycling sticky to tab_id.

TabListSceneLayer is the parent of all currently visible phone tab
switcher CC layers.  It prefers to reuse existing layers instead of
recreating them from scratch.

However, the old logic was vector-based and had no guaranteed
correlation to tab ids, so when a layer in the middle became covered and
invisible, all layers after it were suddenly repurposed to display a
different tab than on the previous frame (and the last layer in the list
was destroyed, not the layer that became invisible).  The thumbnail
subsystems have problems handling this switchover perfectly and
sometimes flicker white or black for one frame, and this is also
inefficient.

This patch replaces the vector of TabLayers with a map sorted by id, so
that when a TabLayer becomes invisible, that one is removed without
disturbing any of the other layers.

BUG= 638068 

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

[modify] https://crrev.com/f859be05a8db1f6301119cd9dfd58d7ddd75ee22/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
[modify] https://crrev.com/f859be05a8db1f6301119cd9dfd58d7ddd75ee22/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h

Comment 4 by aelias@chromium.org, Aug 19 2016

Status: Fixed (was: Assigned)

Comment 5 by aelias@chromium.org, Aug 19 2016

Labels: -M-54 M-53 Merge-Request-53
Status: Assigned (was: Fixed)
On second thought, requesting merge back to M53 based on the timeline request on http://b/30863103.

I think this change is relatively safe/isolated although not totally risk-free, I'm inclined to bake it in one dev channel release to check for crashers, then pull it back to 53.

Comment 6 by dimu@chromium.org, Aug 19 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 7 by sheriffbot@chromium.org, Aug 23 2016

This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 23 2016

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

commit f66182335a8d477501e0657cafc3600ae9896e98
Author: Alexandre Elias <aelias@chromium.org>
Date: Tue Aug 23 19:11:32 2016

Make TabLayer recycling sticky to tab_id.

TabListSceneLayer is the parent of all currently visible phone tab
switcher CC layers.  It prefers to reuse existing layers instead of
recreating them from scratch.

However, the old logic was vector-based and had no guaranteed
correlation to tab ids, so when a layer in the middle became covered and
invisible, all layers after it were suddenly repurposed to display a
different tab than on the previous frame (and the last layer in the list
was destroyed, not the layer that became invisible).  The thumbnail
subsystems have problems handling this switchover perfectly and
sometimes flicker white or black for one frame, and this is also
inefficient.

This patch replaces the vector of TabLayers with a map sorted by id, so
that when a TabLayer becomes invisible, that one is removed without
disturbing any of the other layers.

BUG= 638068 

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

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

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

[modify] https://crrev.com/f66182335a8d477501e0657cafc3600ae9896e98/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
[modify] https://crrev.com/f66182335a8d477501e0657cafc3600ae9896e98/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 23 2016

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

commit f66182335a8d477501e0657cafc3600ae9896e98
Author: Alexandre Elias <aelias@chromium.org>
Date: Tue Aug 23 19:11:32 2016

Make TabLayer recycling sticky to tab_id.

TabListSceneLayer is the parent of all currently visible phone tab
switcher CC layers.  It prefers to reuse existing layers instead of
recreating them from scratch.

However, the old logic was vector-based and had no guaranteed
correlation to tab ids, so when a layer in the middle became covered and
invisible, all layers after it were suddenly repurposed to display a
different tab than on the previous frame (and the last layer in the list
was destroyed, not the layer that became invisible).  The thumbnail
subsystems have problems handling this switchover perfectly and
sometimes flicker white or black for one frame, and this is also
inefficient.

This patch replaces the vector of TabLayers with a map sorted by id, so
that when a TabLayer becomes invisible, that one is removed without
disturbing any of the other layers.

BUG= 638068 

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

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

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

[modify] https://crrev.com/f66182335a8d477501e0657cafc3600ae9896e98/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
[modify] https://crrev.com/f66182335a8d477501e0657cafc3600ae9896e98/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h

Labels: -Hotlist-Merge-Approved
Status: Fixed (was: Assigned)
Project Member

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

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

commit 28162ee142c9e5008fe16a3feb53734d89522f92
Author: Alexandre Elias <aelias@chromium.org>
Date: Wed Aug 24 19:09:50 2016

Make TabLayer recycling sticky to tab_id.

TabListSceneLayer is the parent of all currently visible phone tab
switcher CC layers.  It prefers to reuse existing layers instead of
recreating them from scratch.

However, the old logic was vector-based and had no guaranteed
correlation to tab ids, so when a layer in the middle became covered and
invisible, all layers after it were suddenly repurposed to display a
different tab than on the previous frame (and the last layer in the list
was destroyed, not the layer that became invisible).  The thumbnail
subsystems have problems handling this switchover perfectly and
sometimes flicker white or black for one frame, and this is also
inefficient.

This patch replaces the vector of TabLayers with a map sorted by id, so
that when a TabLayer becomes invisible, that one is removed without
disturbing any of the other layers.

[edited to add more #includes: see http://crbug.com/640352]

BUG= 638068 ,640352

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

Review-Url: https://codereview.chromium.org/2253423003
Cr-Original-Commit-Position: refs/heads/master@{#413244}
Cr-Commit-Position: refs/branch-heads/2785@{#740}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/28162ee142c9e5008fe16a3feb53734d89522f92/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
[modify] https://crrev.com/28162ee142c9e5008fe16a3feb53734d89522f92/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h

For the record, in between #9 and #11, I reverted the patch on 53 branch as https://codereview.chromium.org/2272603004/ due to the missing #include (another header was papering over the problem on ToT so it was only caught on cherry-pick).  For some reason bugdroid didn't post about the revert.  In any case, now relanded and fixed.
Cc: mdjones@chromium.org yus...@chromium.org dtrainor@chromium.org tedc...@chromium.org
 Issue 502998  has been merged into this issue.

Sign in to add a comment