Fix z-order for webview surface control

Set the root surface control transparent, and set the z order of the newly created child surface control to -1.
A new callback is needed to update root surface control in sync from Java side.

Bug: 186750329
Test: use latest APKs from Webview team, play a video, mini toolbar should be visible
Change-Id: I0b37ee8f83fd2b41ff4f2856dbadd31ff6170baf
This commit is contained in:
Huihong Luo
2021-05-03 14:47:36 -07:00
parent 1d88151a38
commit 34f42fdecd
10 changed files with 121 additions and 1 deletions

View File

@@ -197,6 +197,8 @@ ASurfaceControl* WebViewFunctor::getSurfaceControl() {
auto funcs = renderthread::RenderThread::getInstance().getASurfaceControlFunctions();
mSurfaceControl = funcs.createFunc(rootSurfaceControl, "Webview Overlay SurfaceControl");
ASurfaceTransaction* transaction = funcs.transactionCreateFunc();
activeContext->prepareSurfaceControlForWebview();
funcs.transactionSetZOrderFunc(transaction, mSurfaceControl, -1);
funcs.transactionSetVisibilityFunc(transaction, mSurfaceControl,
ASURFACE_TRANSACTION_VISIBILITY_SHOW);
funcs.transactionApplyFunc(transaction);