Make Layer::ShouldHitTest respect SetHideLayerAndSubtree

Ui::Layers call SetHideLayerAndSubtree when they become visible or
hidden. But a cc::Layer with hide_layer_and_subtree = true still
draws its content and is considered hit-testable, though not displayed
on the screen.

This patch makes cc hit testing respect hide_layer_and_subtree and do
not hit test a layer if it's drawn but not displayed on screen.

Bug: 901882
Change-Id: I18c9511c18628067dbcb471cd8dfe43a1e3c6426
Reviewed-by: weiliangc <>
Commit-Queue: Xianda Sun <>
Cr-Commit-Position: refs/heads/master@{#625335}
7 files changed