blob: 840f6e724b034dea8adab1291dec913e356971bd [file] [log] [blame]
Bo Liu10205862022-09-15 16:24:36 -04001/*
2 * Copyright 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * @addtogroup NativeActivity Native Activity
19 * @{
20 */
21
22/**
23 * @file surface_control_jni.h
24 */
25
26#ifndef ANDROID_SURFACE_CONTROL_JNI_H
27#define ANDROID_SURFACE_CONTROL_JNI_H
28
29#include <jni.h>
30#include <sys/cdefs.h>
31
32#include <android/surface_control.h>
33
34__BEGIN_DECLS
35
36/**
37 * Return the ASurfaceControl wrapped by a Java SurfaceControl object.
38 *
Bo Liu80d42db2022-10-11 20:18:59 -040039 * The caller takes ownership of the returned ASurfaceControl returned and must
40 * release it * using ASurfaceControl_release.
41 *
42 * surfaceControlObj must be a non-null instance of android.view.SurfaceControl
43 * and isValid() must be true.
Bo Liu10205862022-09-15 16:24:36 -040044 *
45 * Available since API level 34.
46 */
Bo Liubd5ee8e2022-11-11 14:59:37 -050047ASurfaceControl* _Nonnull ASurfaceControl_fromJava(JNIEnv* _Nonnull env,
Bo Liu10205862022-09-15 16:24:36 -040048 jobject _Nonnull surfaceControlObj) __INTRODUCED_IN(__ANDROID_API_U__);
49
50/**
51 * Return the ASurfaceTransaction wrapped by a Java Transaction object.
52 *
53 * The returned ASurfaceTransaction is still owned by the Java Transaction object is only
54 * valid while the Java Transaction object is alive. In particular, the returned transaction
55 * must NOT be deleted with ASurfaceTransaction_delete.
Bo Liu80d42db2022-10-11 20:18:59 -040056 *
57 * transactionObj must be a non-null instance of
58 * android.view.SurfaceControl.Transaction and close() must not already be called.
Bo Liu10205862022-09-15 16:24:36 -040059 *
60 * Available since API level 34.
61 */
Bo Liubd5ee8e2022-11-11 14:59:37 -050062ASurfaceTransaction* _Nonnull ASurfaceTransaction_fromJava(JNIEnv* _Nonnull env,
Bo Liu10205862022-09-15 16:24:36 -040063 jobject _Nonnull transactionObj) __INTRODUCED_IN(__ANDROID_API_U__);
64
65__END_DECLS
66
67#endif // ANDROID_SURFACE_CONTROL_JNI_H
68/** @} */