From 43ef0c3d9b8fc909d45479fa92f2f91240309a81 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Wed, 3 Apr 2019 17:30:40 -0600 Subject: EGLAttrib requires special handling in JNI EGLAttrib is defined for a C / C++ interface and is intended to be the size of a pointer. That can change depending on which abi the code is built for but Java doesn't have a way of dealing with such types. Java defines EGLAttrib as a jlong, so need to convert jlong to 32bit when running on a 32bit device. Bug: 124382141 Test: atest --all-abi CtsGraphicsTestCases:EGL15Test Change-Id: I966f6a3716b2710e17d10e0d0cb58314853675e0 --- opengl/java/android/opengl/EGL15.java | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'opengl') diff --git a/opengl/java/android/opengl/EGL15.java b/opengl/java/android/opengl/EGL15.java index bd845e7ec1a0..93acc674a4b7 100644 --- a/opengl/java/android/opengl/EGL15.java +++ b/opengl/java/android/opengl/EGL15.java @@ -85,6 +85,19 @@ public final class EGL15 { int offset ); + /** + * C function EGLBoolean eglGetSyncAttrib ( EGLDisplay dpy, EGLSync sync, EGLint attribute, + * EGLAttrib *value ) + */ + + public static native boolean eglGetSyncAttrib( + EGLDisplay dpy, + EGLSync sync, + int attribute, + long[] value, + int offset + ); + // C function EGLBoolean eglDestroySync ( EGLDisplay dpy, EGLSync sync ) public static native boolean eglDestroySync( @@ -101,16 +114,6 @@ public final class EGL15 { long timeout ); - // C function EGLBoolean eglGetSyncAttrib ( EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value ) - - public static native boolean eglGetSyncAttrib( - EGLDisplay dpy, - EGLSync sync, - int attribute, - long[] value, - int offset - ); - // C function EGLDisplay eglGetPlatformDisplay ( EGLenum platform, EGLAttrib native_display, const EGLAttrib *attrib_list ) public static native EGLDisplay eglGetPlatformDisplay( -- cgit v1.2.3