summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
diff options
context:
space:
mode:
authorHuihong Luo <huisinro@google.com>2021-05-03 14:47:36 -0700
committerHuihong Luo <huisinro@google.com>2021-06-18 10:14:22 -0700
commit34f42fdecdf380d82f2be32b3564517002cc2112 (patch)
treeb399058237780bf95b6b6a688e48e3fd727544bc /libs/hwui/renderthread/CanvasContext.cpp
parent1d88151a380c2a8f102c76b8413d17989215ccf8 (diff)
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
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 8bfc2c14ad7c..77e64d5ddea4 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -197,6 +197,7 @@ void CanvasContext::setSurfaceControl(ASurfaceControl* surfaceControl) {
if (surfaceControl == nullptr) {
setASurfaceTransactionCallback(nullptr);
+ setPrepareSurfaceControlForWebviewCallback(nullptr);
}
if (mSurfaceControl != nullptr) {
@@ -918,6 +919,12 @@ bool CanvasContext::mergeTransaction(ASurfaceTransaction* transaction, ASurfaceC
return true;
}
+void CanvasContext::prepareSurfaceControlForWebview() {
+ if (mPrepareSurfaceControlForWebviewCallback) {
+ std::invoke(mPrepareSurfaceControlForWebviewCallback);
+ }
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */