Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Issue 2352733002: android: Fix drawing content layer identification for tab. (Closed)

Created:
4 years, 3 months ago by Khushal
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

android: Fix drawing content layer identification for tab. DoesLeafDrawContents in content_layer.cc traverses the tree to check if the content layer for a tab will draw content. Currently if a layer hides itself and its subtree, but has a descendent which draws content and does not have a background color set, it would assume that the layer will draw. This is wrong since if the layer hides it subtree then its children will never draw. How did this manage to cause the peculiar bug in the tab switcher? Before http://crrev.com/2133873004, the RenderWidgetHostViewAndroid would hold a SurfaceLayer with the frame from the renderer. When the view is hidden, it would SetHideLayerAndSubtree on this layer, and since the layer was the leaf node, DoesLeafDrawContents would correctly identify that the tab's layer does not draw content. This is important since in ContentLayer while we attach both the live and static layer for a tab, the static layer's opacity is left 0 if the content layer draws. After this change, the DelegatedFrameHostAndroid holds a layer which is a container for the SurfaceLayer. When the RenderWidgetHostViewAndroid is now hidden, it hides this container layer instead. This causes DoesLeafDrawContents to incorrectly assume that the tab's content layer will draw. The reason why we see a momentory black flash is that when a tab is hidden, we enter the state above. But in the meanwhile, the now visible tab receives its first frame from the renderer. This will cause the RendererFrameManager to ask the invisible tab to evict its frame. When this happens the DelegatedFrameHostAndroid will destroy the SurfaceLayer and DoesLeafDrawContents in ContentLayer will now know that the tab's layer will not draw. BUG=644159 Committed: https://crrev.com/a15106c4b0abdb45b8d18ba255d6ff49f0e516a9 Cr-Commit-Position: refs/heads/master@{#419580}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -2 lines) Patch
M chrome/browser/android/compositor/layer/content_layer.cc View 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (5 generated)
Khushal
I was thinking if there is a better way to check whether the tab's layer ...
4 years, 3 months ago (2016-09-19 17:39:01 UTC) #2
Khushal
4 years, 3 months ago (2016-09-19 17:59:49 UTC) #4
David Trainor- moved to gerrit
lgtm nice catch!
4 years, 3 months ago (2016-09-19 18:01:05 UTC) #5
David Trainor- moved to gerrit
On 2016/09/19 17:39:01, Khushal wrote: > I was thinking if there is a better way ...
4 years, 3 months ago (2016-09-19 18:02:17 UTC) #6
Ted C
+mdjones lgtm - Is this something we could add a test for? It would be ...
4 years, 3 months ago (2016-09-19 18:48:26 UTC) #8
Khushal
On 2016/09/19 18:48:26, Ted C wrote: > +mdjones > > lgtm - Is this something ...
4 years, 3 months ago (2016-09-19 18:56:56 UTC) #9
Ted C
On 2016/09/19 18:56:56, Khushal wrote: > On 2016/09/19 18:48:26, Ted C wrote: > > +mdjones ...
4 years, 3 months ago (2016-09-19 20:02:28 UTC) #10
no sievers
lgtm. But as discussed there is probably still a race between Hide() and the readback ...
4 years, 3 months ago (2016-09-19 20:17:37 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2352733002/1
4 years, 3 months ago (2016-09-19 20:21:05 UTC) #13
mdjones
lgtm, but it's a bit frustrating that this code relies on properties of the tree ...
4 years, 3 months ago (2016-09-19 20:23:42 UTC) #14
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-09-19 21:53:23 UTC) #15
commit-bot: I haz the power
4 years, 3 months ago (2016-09-19 21:55:25 UTC) #17
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/a15106c4b0abdb45b8d18ba255d6ff49f0e516a9
Cr-Commit-Position: refs/heads/master@{#419580}

Powered by Google App Engine
This is Rietveld 408576698