Disable Webview Overlay when invisible

Remove Webview overlays when Webview node is set to invisible

Bug: 187292989
Test: play a video in a Webview, toggle visibility for the view, check
existence of a surface control named as "Webview Overlay
SurfaceControl#0"

Change-Id: If47a78a8ae1f7b65b9e7ab983ec72f580d78191a
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index 894b479..eb5878d 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -133,6 +133,12 @@
         }
     }
 
+    void onRemovedFromTree() {
+        if (mImpl) {
+            mImpl->onRemovedFromTree();
+        }
+    }
+
     [[nodiscard]] bool hasText() const {
         return mImpl && mImpl->hasText();
     }
@@ -172,6 +178,7 @@
             return false;
         }
         void syncContents(const WebViewSyncData& data) { }
+        void onRemovedFromTree() { }
         void applyColorTransform(ColorTransform transform) { }
     };
 
@@ -298,6 +305,10 @@
         apply([&](auto& it) { it.syncContents(data); });
     }
 
+    void onRemovedFromTree() {
+        apply([&](auto& it) { it.onRemovedFromTree(); });
+    }
+
     [[nodiscard]] bool hasText() const {
         return apply([](const auto& it) -> auto { return it.hasText(); });
     }