示例#1
0
文件: egl.c 项目: gripped/hybris
EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
		EGLNativePixmapType pixmap,
		const EGLint *attrib_list)
{
	EGL_DLSYM(&_eglCreatePixmapSurface, "eglCreatePixmapSurface");
	return (*_eglCreatePixmapSurface)(dpy, config, pixmap, attrib_list);
}
示例#2
0
文件: egl.c 项目: gripped/hybris
EGLSurface eglCreatePbufferFromClientBuffer(
		EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
		EGLConfig config, const EGLint *attrib_list)
{
	EGL_DLSYM(&_eglCreatePbufferFromClientBuffer, "eglCreatePbufferFromClientBuffer");
	return (*_eglCreatePbufferFromClientBuffer)(dpy, buftype, buffer, config, attrib_list);
}
示例#3
0
文件: egl.c 项目: gripped/hybris
EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
		EGLint attribute, EGLint *value)
{
	EGL_DLSYM(&_eglGetConfigAttrib, "eglGetConfigAttrib");
	return (*_eglGetConfigAttrib)(dpy, config,
			attribute, value);
}
示例#4
0
文件: egl.c 项目: thayama/libegl
EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
				  EGLNativeWindowType win,
				  const EGLint * attrib_list)
{
	EGL_DEBUG("%s: %s\n", __FILE__, __func__);
	EGL_DLSYM(eglCreateWindowSurface);
	return _eglCreateWindowSurface(dpy, config, win, attrib_list);
}
示例#5
0
文件: egl.c 项目: thayama/libegl
EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
				  EGLNativePixmapType pixmap,
				  const EGLint * attrib_list)
{
	EGL_DEBUG("%s: %s\n", __FILE__, __func__);
	EGL_DLSYM(eglCreatePixmapSurface);
	return _eglCreatePixmapSurface(dpy, config, pixmap, attrib_list);
}
示例#6
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglTerminate(EGLDisplay dpy)
{
	EGL_DLSYM(&_eglTerminate, "eglTerminate");

	struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy);
	ws_Terminate(display);
	return (*_eglTerminate)(dpy);
}
示例#7
0
文件: egl.c 项目: thayama/libegl
EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
			    EGLContext share_context,
			    const EGLint * attrib_list)
{
	EGL_DEBUG("%s: %s\n", __FILE__, __func__);
	EGL_DLSYM(eglCreateContext);
	return _eglCreateContext(dpy, config, share_context, attrib_list);
}
示例#8
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
		EGLConfig *configs, EGLint config_size,
		EGLint *num_config)
{
	EGL_DLSYM(&_eglChooseConfig, "eglChooseConfig");
	return (*_eglChooseConfig)(dpy, attrib_list,
			configs, config_size,
			num_config);
}
示例#9
0
文件: egl.c 项目: F35X70/libhybris
EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
{
	EGLBoolean ret; 
	HYBRIS_TRACE_BEGIN("hybris-egl", "eglSwapBuffers", "");
	EGL_DLSYM(&_eglSwapBuffers, "eglSwapBuffers");
	ret = (*_eglSwapBuffers)(dpy, surface);
	HYBRIS_TRACE_END("hybris-egl", "eglSwapBuffers", "");
	return ret;
}
示例#10
0
文件: egl.c 项目: thayama/libegl
EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint * attrib_list,
			   EGLConfig * configs, EGLint config_size,
			   EGLint * num_config)
{
	EGL_DEBUG("%s: %s\n", __FILE__, __func__);
	EGL_DLSYM(eglChooseConfig);
	return _eglChooseConfig(dpy, attrib_list,
			       configs, config_size, num_config);
}
示例#11
0
文件: egl.c 项目: thayama/libegl
EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
					    EGLClientBuffer buffer,
					    EGLConfig config,
					    const EGLint * attrib_list)
{
	EGL_DEBUG("%s: %s\n", __FILE__, __func__);
	EGL_DLSYM(eglCreatePbufferFromClientBuffer);
	return _eglCreatePbufferFromClientBuffer(dpy, buftype, buffer,
						config, attrib_list);
}
示例#12
0
文件: egl.c 项目: F35X70/libhybris
EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
		EGLNativeWindowType win,
		const EGLint *attrib_list)
{
	EGL_DLSYM(&_eglCreateWindowSurface, "eglCreateWindowSurface");

	win = ws_CreateWindow(win,  _egldisplay2NDT(dpy));
	
	assert(((struct ANativeWindowBuffer *) win)->common.magic == ANDROID_NATIVE_WINDOW_MAGIC);

	EGLSurface result = (*_eglCreateWindowSurface)(dpy, config, win, attrib_list);
	egl_helper_push_mapping(result, win);
	return result;
}
示例#13
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
{
	EGLBoolean ret;
	EGLSurface surface;
	EGLNativeWindowType win;
	HYBRIS_TRACE_BEGIN("hybris-egl", "eglSwapInterval", "=%d", interval);

	/* Some egl implementations don't pass through the setSwapInterval
	 * call.  Since we may support various swap intervals internally, we'll
	 * call it anyway and then give the wrapped egl implementation a chance
	 * to chage it. */
	EGL_DLSYM(&_eglGetCurrentSurface, "eglGetCurrentSurface");
	surface = (*_eglGetCurrentSurface)(EGL_DRAW);
	if (egl_helper_has_mapping(surface))
	    ws_setSwapInterval(dpy, egl_helper_get_mapping(surface), interval);

	HYBRIS_TRACE_BEGIN("native-egl", "eglSwapInterval", "=%d", interval);
	EGL_DLSYM(&_eglSwapInterval, "eglSwapInterval");
	ret = (*_eglSwapInterval)(dpy, interval);
	HYBRIS_TRACE_END("native-egl", "eglSwapInterval", "");
	HYBRIS_TRACE_END("hybris-egl", "eglSwapInterval", "");
	return ret;
}
示例#14
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
{
	EGL_DLSYM(&_eglDestroySurface, "eglDestroySurface");
	EGLBoolean result = (*_eglDestroySurface)(dpy, surface);

	/**
         * If the surface was created via eglCreateWindowSurface, we must
         * notify the ws about surface destruction for clean-up.
	 **/
	if (egl_helper_has_mapping(surface)) {
	    ws_DestroyWindow(egl_helper_pop_mapping(surface));
	}

	return result;
}
示例#15
0
文件: egl.c 项目: F35X70/libhybris
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;
}
示例#16
0
文件: egl.c 项目: nbr11/libhybris
EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
		EGLContext share_context,
		const EGLint *attrib_list)
{
	EGL_DLSYM(&_eglCreateContext, "eglCreateContext");

	EGLint *p = attrib_list;
	while (p != NULL && *p != EGL_NONE) {
		if (*p == EGL_CONTEXT_CLIENT_VERSION) {
			_egl_context_client_version = p[1];
		}
		p += 2;
	}

	return (*_eglCreateContext)(dpy, config, share_context, attrib_list);
}
示例#17
0
文件: egl.c 项目: F35X70/libhybris
__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
{
	EGL_DLSYM(&_eglGetProcAddress, "eglGetProcAddress");
	if (strcmp(procname, "eglCreateImageKHR") == 0)
	{
		return _my_eglCreateImageKHR;
	} 
	else if (strcmp(procname, "glEGLImageTargetTexture2DOES") == 0)
	{
		return _my_glEGLImageTargetTexture2DOES;
	}
	__eglMustCastToProperFunctionPointerType ret = ws_eglGetProcAddress(procname);
	if (ret == NULL)
		return (*_eglGetProcAddress)(procname);
	else return ret;
}
示例#18
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean _my_eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
{
	EGLNativeWindowType win;
	EGLBoolean ret;
	HYBRIS_TRACE_BEGIN("hybris-egl", "eglSwapBuffersWithDamageEXT", "");
	EGL_DLSYM(&_eglSwapBuffers, "eglSwapBuffers");

	if (egl_helper_has_mapping(surface)) {
		win = egl_helper_get_mapping(surface);
		ws_prepareSwap(dpy, win, rects, n_rects);
		ret = (*_eglSwapBuffers)(dpy, surface);
		ws_finishSwap(dpy, win);
	} else {
		ret = (*_eglSwapBuffers)(dpy, surface);
	}
	HYBRIS_TRACE_END("hybris-egl", "eglSwapBuffersWithDamageEXT", "");
	return ret;
}
示例#19
0
文件: egl.c 项目: F35X70/libhybris
EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
{
	EGL_DLSYM(&_eglGetDisplay, "eglGetDisplay");
	EGLNativeDisplayType real_display;

	if (!ws_IsValidDisplay(display_id))
	{
		return EGL_NO_DISPLAY;
	}

	real_display = (*_eglGetDisplay)(EGL_DEFAULT_DISPLAY);
	if (real_display == EGL_NO_DISPLAY)
	{
		return EGL_NO_DISPLAY;
	}
	_addMapping(display_id, real_display);
	return real_display;
}
示例#20
0
文件: egl.c 项目: thayama/libegl
__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
{
	EGL_DLSYM(eglGetProcAddress);

	EGL_DEBUG("%s: %s(%s)\n", __FILE__, __func__, procname);
	if (strcmp(procname, "eglCreateImageKHR") == 0) {
		return (__eglMustCastToProperFunctionPointerType)__eglCreateImageKHR;
	}
#ifdef WANT_WAYLAND
	else if (strcmp(procname, "eglBindWaylandDisplayWL") == 0) {
		return (__eglMustCastToProperFunctionPointerType)__eglBindWaylandDisplayWL;
	} else if (strcmp(procname, "eglUnbindWaylandDisplayWL") == 0) {
		return (__eglMustCastToProperFunctionPointerType)__eglUnbindWaylandDisplayWL;
	} else if (strcmp(procname, "eglQueryWaylandBufferWL") == 0) {
		return (__eglMustCastToProperFunctionPointerType)__eglQueryWaylandBufferWL;
	}
#endif
	return _eglGetProcAddress(procname);
}
示例#21
0
文件: egl.c 项目: nbr11/libhybris
EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
		EGLNativeWindowType win,
		const EGLint *attrib_list)
{
	EGL_DLSYM(&_eglCreateWindowSurface, "eglCreateWindowSurface");

	HYBRIS_TRACE_BEGIN("hybris-egl", "eglCreateWindowSurface", "");
	struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy);
	win = ws_CreateWindow(win, display);

	assert(((struct ANativeWindowBuffer *) win)->common.magic == ANDROID_NATIVE_WINDOW_MAGIC);

	HYBRIS_TRACE_BEGIN("native-egl", "eglCreateWindowSurface", "");
	EGLSurface result = (*_eglCreateWindowSurface)(dpy, config, win, attrib_list);
	HYBRIS_TRACE_END("native-egl", "eglCreateWindowSurface", "");
	egl_helper_push_mapping(result, win);

	HYBRIS_TRACE_END("hybris-egl", "eglCreateWindowSurface", "");
	return result;
}
示例#22
0
文件: egl.c 项目: nbr11/libhybris
EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
{
	EGL_DLSYM(&_eglGetDisplay, "eglGetDisplay");
	EGLNativeDisplayType real_display;

	real_display = (*_eglGetDisplay)(EGL_DEFAULT_DISPLAY);
	if (real_display == EGL_NO_DISPLAY)
	{
		return EGL_NO_DISPLAY;
	}

	struct _EGLDisplay *dpy = hybris_egl_display_get_mapping(real_display);
	if (!dpy) {
		dpy = ws_GetDisplay(display_id);
		if (!dpy) {
			return EGL_NO_DISPLAY;
		}
		dpy->dpy = real_display;
		_addMapping(dpy);
	}

	return real_display;
}
示例#23
0
文件: egl.c 项目: nbr11/libhybris
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;
}
示例#24
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
		EGLNativePixmapType target)
{
	EGL_DLSYM(&_eglCopyBuffers, "eglCopyBuffers");
	return (*_eglCopyBuffers)(dpy, surface, target);
}
示例#25
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglWaitNative(EGLint engine)
{
	EGL_DLSYM(&_eglWaitNative, "eglWaitNative");
	return (*_eglWaitNative)(engine);
}
示例#26
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglWaitGL(void)
{
	EGL_DLSYM(&_eglWaitGL, "eglWaitGL");
	return (*_eglWaitGL)();
}
示例#27
0
文件: egl.c 项目: nbr11/libhybris
EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx,
		EGLint attribute, EGLint *value)
{
	EGL_DLSYM(&_eglQueryContext, "eglQueryContext");
	return (*_eglQueryContext)(dpy, ctx, attribute, value);
}
示例#28
0
文件: egl.c 项目: nbr11/libhybris
EGLDisplay eglGetCurrentDisplay(void)
{
	EGL_DLSYM(&_eglGetCurrentDisplay, "eglGetCurrentDisplay");
	return (*_eglGetCurrentDisplay)();
}
示例#29
0
文件: egl.c 项目: nbr11/libhybris
EGLSurface eglGetCurrentSurface(EGLint readdraw)
{
	EGL_DLSYM(&_eglGetCurrentSurface, "eglGetCurrentSurface");
	return (*_eglGetCurrentSurface)(readdraw);
}
示例#30
0
文件: egl.c 项目: nbr11/libhybris
EGLContext eglGetCurrentContext(void)
{
	EGL_DLSYM(&_eglGetCurrentContext, "eglGetCurrentContext");
	return (*_eglGetCurrentContext)();
}