summaryrefslogtreecommitdiff
path: root/native/android/surface_control.cpp
diff options
context:
space:
mode:
authorHuihong Luo <huisinro@google.com>2021-01-28 15:24:19 -0800
committerHuihong Luo <huisinro@google.com>2021-02-11 17:59:04 +0000
commit91697e13fff4c07e4e7c75013c94992cf5a92574 (patch)
tree0df2e3819e6093cccdf6fe591d08e35667541033 /native/android/surface_control.cpp
parent06bdb473bf903bde613c5bc21e41df30f751e091 (diff)
Add ASurfaceControl_acquire api
hwui needs this api to hold a reference to a surface control object passed from java layer. Bug: 173671170 Test: manual Change-Id: I2b8417c289718bb1b99af47d7828e91b16785123
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r--native/android/surface_control.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp
index 189be800e018..c1b5f1ddd423 100644
--- a/native/android/surface_control.cpp
+++ b/native/android/surface_control.cpp
@@ -185,10 +185,16 @@ ASurfaceControl* ASurfaceControl_create(ASurfaceControl* parent, const char* deb
return reinterpret_cast<ASurfaceControl*>(surfaceControl.get());
}
+void ASurfaceControl_acquire(ASurfaceControl* aSurfaceControl) {
+ SurfaceControl* surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
+
+ SurfaceControl_acquire(surfaceControl);
+}
+
void ASurfaceControl_release(ASurfaceControl* aSurfaceControl) {
- sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
+ SurfaceControl* surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
- SurfaceControl_release(surfaceControl.get());
+ SurfaceControl_release(surfaceControl);
}
ASurfaceTransaction* ASurfaceTransaction_create() {