summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
diff options
context:
space:
mode:
authorHuihong Luo <huisinro@google.com>2021-01-15 14:27:06 -0800
committerJorim Jaggi <jjaggi@google.com>2021-02-16 17:38:12 +0100
commit5fdf7b8d26f3cd1a2f2fb8a441d40d33270d3b77 (patch)
tree42fb177d3a385875f96f560e5abc6ab35d034d7c /libs/hwui/renderthread/RenderProxy.cpp
parentd8385e060c12acc21010956f4fbe57daa526a41a (diff)
Add SurfaceControl to hwui
add a method, setSurfaceControl, for java layer to pass surface control to the render thread Bug: 173671170 Test: call setSurfaceControl method in ViewRootImpl.java Change-Id: I886a79c377938f19cf38b9058f2bec64e1439000
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 0ade8dde12eb..e14842f89b61 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -84,6 +84,19 @@ void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) {
});
}
+void RenderProxy::setSurfaceControl(ASurfaceControl* surfaceControl) {
+ auto funcs = mRenderThread.getASurfaceControlFunctions();
+ if (surfaceControl) {
+ funcs.acquireFunc(surfaceControl);
+ }
+ mRenderThread.queue().post([this, control = surfaceControl, funcs]() mutable {
+ mContext->setSurfaceControl(control);
+ if (control) {
+ funcs.releaseFunc(control);
+ }
+ });
+}
+
void RenderProxy::allocateBuffers() {
mRenderThread.queue().post([=]() { mContext->allocateBuffers(); });
}