static EGLImageKHR _my_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) { EGL_DLSYM(&_eglCreateImageKHR, "eglCreateImageKHR"); EGLenum newtarget = target; EGLClientBuffer newbuffer = buffer; ws_passthroughImageKHR(&newtarget, &newbuffer); if (newtarget == EGL_NATIVE_BUFFER_ANDROID) { assert(((struct ANativeWindowBuffer *) newbuffer)->common.magic == ANDROID_NATIVE_BUFFER_MAGIC); attrib_list=NULL; } EGLImageKHR ret = (*_eglCreateImageKHR)(dpy, EGL_NO_CONTEXT, newtarget, newbuffer, attrib_list); return ret; }
static EGLImageKHR _my_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) { EGL_DLSYM(&_eglCreateImageKHR, "eglCreateImageKHR"); EGLContext newctx = ctx; EGLenum newtarget = target; EGLClientBuffer newbuffer = buffer; const EGLint *newattrib_list = attrib_list; ws_passthroughImageKHR(&newctx, &newtarget, &newbuffer, &newattrib_list); EGLImageKHR eik = (*_eglCreateImageKHR)(dpy, newctx, newtarget, newbuffer, newattrib_list); if (eik == EGL_NO_IMAGE_KHR) { return EGL_NO_IMAGE_KHR; } struct egl_image *image; image = malloc(sizeof *image); image->egl_image = eik; image->egl_buffer = buffer; image->target = target; return (EGLImageKHR)image; }