(merge) Avoid cloning of layer tree when using mirror windows

This patch fixes one of the reasons for the transparent chrome window
We clone the window layer tree after we create a mirror window for
overview mode. This does not work well with transferable resource and
when to release them. This was resulting in empty resource texture
being displayed in cloned + mirrored windows at times. The resource
was being released as soon as the original layer was destroyed after

The reason cloning was performed on the mirror window was to purge the
texture memory being used by the now minimized window. Recreating the
layer tree allowed the ui to delete the old layer tree and thus the old

This patch replaces the cloning that happens after a mirror window tree
is created while achieving the same goal of purging unneeded texture
memory by tricking the compositor into resetting its visibility.

           mode, solid color layer

Bug: 923595
Change-Id: I56c9a201922a4d0f2047b08979fa3f0589789c37
Component: ui layer, delegated frame host, stale content, overview
Reviewed-on: https://chromium-review.googlesource.com/c/1448119
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Reviewed-by: Malay Keshav <malaykeshav@chromium.org>
Reviewed-by: Sammie Quon <sammiequon@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#628469}(cherry picked from commit 6b9172ee53eec7bec1fa390d67b7e4cd22e54422)
Reviewed-on: https://chromium-review.googlesource.com/c/1452483
Cr-Commit-Position: refs/branch-heads/3683@{#166}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
4 files changed