Generalize layer mirroring for phantom windows

Previously, the layers of a phantom window were recreated when the
surface changed in the corresponding layers of the original window.
The code also assumed that layers with surfaces are leaves in the
layer tree, but Exosphere surfaces are nested. Recursive layer
cloning would be inefficient for surfaces changing in each frame,
so this CL adds an alternative way to mirror layers. In addition,
the bounds of Exosphere surfaces relative to their parent window
are updated whenever the window moves, so this CL provides a way
to synchronize relative positions of layers in phantom windows.

In addition to implementing phantom windows for ARC apps, this CL
fixes three bugs related to mirroring:

  1) Memory corruption due to the non-recursive layer cloning.
  2) Dangling pointers due to observers sticking around.
  3) Black Alt+Tab previews for ARC windows.

BUG=642894
BUG=649452
BUG=653113
TEST=ARC apps that render continuously (e.g. games, video players)
     can be dragged to external displays, and their content is
     mirrored in phantom windows.
TEST=ARC apps are mirrored in Alt+Tab previews.
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2383263002
Cr-Commit-Position: refs/heads/master@{#427891}
40 files changed