Descriptionandroid: 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 #
Messages
Total messages: 17 (5 generated)
|