ab6fc2a86f
EGL classes in frameworks/base have to be updated to support 64-bit platforms. Key changes in the EGL classes include [x] EGLObjectHandle class - EGLObjectHandle class has two public methods (constructor and getHandle) that assume handles are 32-bit. They have not been changed. Instead, two new hidden methods (EGLObjectHandle(long) and getNativeHandle) have been added. [x] EG14 class - Two public methods eglGetDisplay and eglCreatePbufferFromClientBuffer assume that handles are 32-bit. They have been changed to throw unsupported operation exception on non 32-bit machines. Two new methods eglGetDisplay(long) and eglCreatePbufferFromClientBuffer(...long buffer..) have been added to support 64-bit handles. To allow the above changes in frameworks/base EGL classes, corresponding code generation mechanism in frameworks/native has been updated. Change-Id: I5d0a62e10c20ccf05f610d6608b8dfb6414b5116 Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
75 lines
2.8 KiB
C++
Executable File
75 lines
2.8 KiB
C++
Executable File
/* EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) */
|
|
static jobject
|
|
android_eglCreatePbufferFromClientBuffer
|
|
(JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jlong buffer, jobject config, jintArray attrib_list_ref, jint offset) {
|
|
jint _exception = 0;
|
|
const char * _exceptionType = NULL;
|
|
const char * _exceptionMessage = NULL;
|
|
EGLSurface _returnValue = (EGLSurface) 0;
|
|
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
|
|
EGLConfig config_native = (EGLConfig) fromEGLHandle(_env, eglconfigGetHandleID, config);
|
|
bool attrib_list_sentinel = false;
|
|
EGLint *attrib_list_base = (EGLint *) 0;
|
|
jint _remaining;
|
|
EGLint *attrib_list = (EGLint *) 0;
|
|
|
|
if (!attrib_list_ref) {
|
|
_exception = 1;
|
|
_exceptionType = "java/lang/IllegalArgumentException";
|
|
_exceptionMessage = "attrib_list == null";
|
|
goto exit;
|
|
}
|
|
if (offset < 0) {
|
|
_exception = 1;
|
|
_exceptionType = "java/lang/IllegalArgumentException";
|
|
_exceptionMessage = "offset < 0";
|
|
goto exit;
|
|
}
|
|
_remaining = _env->GetArrayLength(attrib_list_ref) - offset;
|
|
attrib_list_base = (EGLint *)
|
|
_env->GetPrimitiveArrayCritical(attrib_list_ref, (jboolean *)0);
|
|
attrib_list = attrib_list_base + offset;
|
|
attrib_list_sentinel = false;
|
|
for (int i = _remaining - 1; i >= 0; i--) {
|
|
if (attrib_list[i] == EGL_NONE){
|
|
attrib_list_sentinel = true;
|
|
break;
|
|
}
|
|
}
|
|
if (attrib_list_sentinel == false) {
|
|
_exception = 1;
|
|
_exceptionType = "java/lang/IllegalArgumentException";
|
|
_exceptionMessage = "attrib_list must contain EGL_NONE!";
|
|
goto exit;
|
|
}
|
|
|
|
_returnValue = eglCreatePbufferFromClientBuffer(
|
|
(EGLDisplay)dpy_native,
|
|
(EGLenum)buftype,
|
|
reinterpret_cast<EGLClientBuffer>(buffer),
|
|
(EGLConfig)config_native,
|
|
(EGLint *)attrib_list
|
|
);
|
|
|
|
exit:
|
|
if (attrib_list_base) {
|
|
_env->ReleasePrimitiveArrayCritical(attrib_list_ref, attrib_list_base,
|
|
JNI_ABORT);
|
|
}
|
|
if (_exception) {
|
|
jniThrowException(_env, _exceptionType, _exceptionMessage);
|
|
}
|
|
return toEGLHandle(_env, eglsurfaceClass, eglsurfaceConstructor, _returnValue);
|
|
}
|
|
|
|
static jobject
|
|
android_eglCreatePbufferFromClientBufferInt
|
|
(JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jint buffer, jobject config, jintArray attrib_list_ref, jint offset) {
|
|
if(sizeof(void*) != sizeof(uint32_t)) {
|
|
jniThrowException(_env, "java/lang/UnsupportedOperationException", "eglCreatePbufferFromClientBuffer");
|
|
return 0;
|
|
}
|
|
return android_eglCreatePbufferFromClientBuffer(_env, _this, dpy, buftype, buffer, config, attrib_list_ref, offset);
|
|
}
|
|
|