Permalink
...
Checking mergeability…
Don’t worry, you can still create the pull request.
Comparing changes
Open a pull request
- 13 commits
- 15 files changed
- 0 commit comments
- 2 contributors
Unified
Split
Showing
with
422 additions
and 71 deletions.
- +12 −0 hybris/configure.ac
- +7 −6 hybris/egl/egl.c
- +7 −7 hybris/egl/helper.cpp
- +4 −4 hybris/egl/helper.h
- +4 −0 hybris/egl/platforms/Makefile.am
- +2 −2 hybris/egl/platforms/common/eglplatformcommon.cpp
- +1 −1 hybris/egl/platforms/common/eglplatformcommon.h
- +10 −7 hybris/egl/platforms/fbdev/eglplatform_fbdev.cpp
- +9 −5 hybris/egl/platforms/hwcomposer/eglplatform_hwcomposer.cpp
- +17 −0 hybris/egl/platforms/mir/Makefile.am
- +300 −0 hybris/egl/platforms/mir/eglplatform_mir.cpp
- +7 −6 hybris/egl/platforms/null/eglplatform_null.c
- +13 −12 hybris/egl/platforms/wayland/eglplatform_wayland.cpp
- +8 −8 hybris/egl/ws.c
- +21 −13 hybris/egl/ws.h
View
12
hybris/configure.ac
| @@ -85,6 +85,17 @@ AC_ARG_ENABLE(wayland, | ||
| [wayland="no"]) | ||
| AM_CONDITIONAL( [WANT_WAYLAND], [test x"$wayland" = x"yes"]) | ||
| +AC_ARG_ENABLE(mir, | ||
| + [ --enable-mir Enable mir support (default=disabled)], | ||
| + [mir=$enableval | ||
| + PKG_CHECK_MODULES(MIR_CLIENT, mirclient,, exit) | ||
| + MIR_PREFIX=`$PKG_CONFIG --variable=prefix mirclient` | ||
| + | ||
| + AC_DEFINE(WANT_MIR, [], [We want Mir support]) | ||
| +], | ||
| + [mir="no"]) | ||
| +AM_CONDITIONAL( [WANT_MIR], [test x"$mir" = x"yes"]) | ||
| + | ||
| AC_ARG_ENABLE(wayland_serverside_buffers, | ||
| [ --enable-wayland_serverside_buffers Enable serverside buffer allocation for wayland (default=enabled)], | ||
| [wayland_serverside_buffers=$enableval], | ||
| @@ -254,6 +265,7 @@ AC_CONFIG_FILES([ | ||
| egl/platforms/null/Makefile | ||
| egl/platforms/fbdev/Makefile | ||
| egl/platforms/wayland/Makefile | ||
| + egl/platforms/mir/Makefile | ||
| egl/platforms/hwcomposer/Makefile | ||
| egl/platforms/hwcomposer/hwcomposer-egl.pc | ||
| glesv1/glesv1_cm.pc | ||
View
13
hybris/egl/egl.c
| @@ -238,17 +238,17 @@ EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, | ||
| HYBRIS_TRACE_BEGIN("hybris-egl", "eglCreateWindowSurface", ""); | ||
| struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy); | ||
| - win = ws_CreateWindow(win, display); | ||
| + struct _EGLNativeWindowType* window = ws_CreateWindow(win, display, config); | ||
| - assert(((struct ANativeWindowBuffer *) win)->common.magic == ANDROID_NATIVE_WINDOW_MAGIC); | ||
| + assert(((struct ANativeWindowBuffer *) window->win)->common.magic == ANDROID_NATIVE_WINDOW_MAGIC); | ||
| HYBRIS_TRACE_BEGIN("native-egl", "eglCreateWindowSurface", ""); | ||
| - EGLSurface result = (*_eglCreateWindowSurface)(dpy, config, win, attrib_list); | ||
| + EGLSurface result = (*_eglCreateWindowSurface)(dpy, config, window->win, attrib_list); | ||
| HYBRIS_TRACE_END("native-egl", "eglCreateWindowSurface", ""); | ||
| if (result != EGL_NO_SURFACE) | ||
| - egl_helper_push_mapping(result, win); | ||
| + egl_helper_push_mapping(result, window); | ||
| HYBRIS_TRACE_END("hybris-egl", "eglCreateWindowSurface", ""); | ||
| return result; | ||
| @@ -334,7 +334,7 @@ HYBRIS_IMPLEMENT_FUNCTION1(egl, EGLBoolean, eglWaitNative, EGLint); | ||
| EGLBoolean _my_eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects) | ||
| { | ||
| - EGLNativeWindowType win; | ||
| + struct _EGLNativeWindowType* win; | ||
| EGLBoolean ret; | ||
| HYBRIS_TRACE_BEGIN("hybris-egl", "eglSwapBuffersWithDamageEXT", ""); | ||
| HYBRIS_DLSYSM(egl, &_eglSwapBuffers, "eglSwapBuffers"); | ||
| @@ -371,7 +371,8 @@ static EGLImageKHR _my_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum | ||
| EGLClientBuffer newbuffer = buffer; | ||
| const EGLint *newattrib_list = attrib_list; | ||
| - ws_passthroughImageKHR(&newctx, &newtarget, &newbuffer, &newattrib_list); | ||
| + struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy); | ||
| + ws_passthroughImageKHR(display, &newctx, &newtarget, &newbuffer, &newattrib_list); | ||
| EGLImageKHR eik = (*_eglCreateImageKHR)(dpy, newctx, newtarget, newbuffer, newattrib_list); | ||
View
14
hybris/egl/helper.cpp
| @@ -25,10 +25,10 @@ | ||
| /* Keep track of active EGL window surfaces */ | ||
| -static std::map<EGLSurface,EGLNativeWindowType> _surface_window_map; | ||
| +static std::map<EGLSurface, _EGLNativeWindowType*> _surface_window_map; | ||
| -void egl_helper_push_mapping(EGLSurface surface, EGLNativeWindowType window) | ||
| +void egl_helper_push_mapping(EGLSurface surface, _EGLNativeWindowType* window) | ||
| { | ||
| assert(!egl_helper_has_mapping(surface)); | ||
| @@ -40,9 +40,9 @@ int egl_helper_has_mapping(EGLSurface surface) | ||
| return (_surface_window_map.find(surface) != _surface_window_map.end()); | ||
| } | ||
| -EGLNativeWindowType egl_helper_get_mapping(EGLSurface surface) | ||
| +_EGLNativeWindowType* egl_helper_get_mapping(EGLSurface surface) | ||
| { | ||
| - std::map<EGLSurface,EGLNativeWindowType>::iterator it; | ||
| + std::map<EGLSurface,_EGLNativeWindowType*>::iterator it; | ||
| it = _surface_window_map.find(surface); | ||
| /* Caller must check with egl_helper_has_mapping() before */ | ||
| @@ -51,15 +51,15 @@ EGLNativeWindowType egl_helper_get_mapping(EGLSurface surface) | ||
| return it->second; | ||
| } | ||
| -EGLNativeWindowType egl_helper_pop_mapping(EGLSurface surface) | ||
| +_EGLNativeWindowType* egl_helper_pop_mapping(EGLSurface surface) | ||
| { | ||
| - std::map<EGLSurface,EGLNativeWindowType>::iterator it; | ||
| + std::map<EGLSurface,_EGLNativeWindowType*>::iterator it; | ||
| it = _surface_window_map.find(surface); | ||
| /* Caller must check with egl_helper_has_mapping() before */ | ||
| assert(it != _surface_window_map.end()); | ||
| - EGLNativeWindowType result = it->second; | ||
| + _EGLNativeWindowType* result = it->second; | ||
| _surface_window_map.erase(it); | ||
| return result; | ||
| } | ||
View
8
hybris/egl/helper.h
| @@ -23,24 +23,24 @@ | ||
| #include <EGL/egl.h> | ||
| - | ||
| +#include "ws.h" | ||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
| /* Add new mapping from surface to window */ | ||
| -void egl_helper_push_mapping(EGLSurface surface, EGLNativeWindowType window); | ||
| +void egl_helper_push_mapping(EGLSurface surface, struct _EGLNativeWindowType* window); | ||
| /* Check if a mapping for a surface exist */ | ||
| int egl_helper_has_mapping(EGLSurface surface); | ||
| /* Return (without removing) the mapping for a surface */ | ||
| -EGLNativeWindowType egl_helper_get_mapping(EGLSurface surface); | ||
| +struct _EGLNativeWindowType* egl_helper_get_mapping(EGLSurface surface); | ||
| /* Return and remove the mapping for a surface */ | ||
| -EGLNativeWindowType egl_helper_pop_mapping(EGLSurface surface); | ||
| +struct _EGLNativeWindowType* egl_helper_pop_mapping(EGLSurface surface); | ||
| #ifdef __cplusplus | ||
View
4
hybris/egl/platforms/Makefile.am
| @@ -11,4 +11,8 @@ if WANT_WAYLAND | ||
| SUBDIRS += wayland | ||
| endif | ||
| +if WANT_MIR | ||
| +SUBDIRS += mir | ||
| +endif | ||
| + | ||
View
4
hybris/egl/platforms/common/eglplatformcommon.cpp
| @@ -43,7 +43,7 @@ extern "C" int hybris_egl_has_mapping(EGLSurface surface) | ||
| return (*my_egl_interface->has_mapping)(surface); | ||
| } | ||
| -EGLNativeWindowType hybris_egl_get_mapping(EGLSurface surface) | ||
| +struct _EGLNativeWindowType* hybris_egl_get_mapping(EGLSurface surface) | ||
| { | ||
| return (*my_egl_interface->get_mapping)(surface); | ||
| } | ||
| @@ -265,7 +265,7 @@ extern "C" EGLBoolean eglplatformcommon_eglHybrisReleaseNativeBuffer(EGLClientBu | ||
| extern "C" void | ||
| -eglplatformcommon_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list) | ||
| +eglplatformcommon_passthroughImageKHR(struct _EGLDisplay*, EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list) | ||
| { | ||
| #ifdef WANT_WAYLAND | ||
| static int debugenvchecked = 0; | ||
View
2
hybris/egl/platforms/common/eglplatformcommon.h
| @@ -6,6 +6,6 @@ | ||
| void eglplatformcommon_init(struct ws_egl_interface *egl_iface, gralloc_module_t *gralloc, alloc_device_t *allocdevice); | ||
| __eglMustCastToProperFunctionPointerType eglplatformcommon_eglGetProcAddress(const char *procname); | ||
| -void eglplatformcommon_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list); | ||
| +void eglplatformcommon_passthroughImageKHR(struct _EGLDisplay*, EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list); | ||
| const char *eglplatformcommon_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name)); | ||
| #endif | ||
View
17
hybris/egl/platforms/fbdev/eglplatform_fbdev.cpp
| @@ -61,39 +61,42 @@ extern "C" void fbdevws_Terminate(_EGLDisplay *dpy) | ||
| delete dpy; | ||
| } | ||
| -extern "C" EGLNativeWindowType fbdevws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display) | ||
| +extern "C" struct _EGLNativeWindowType *fbdevws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display, EGLConfig) | ||
| { | ||
| assert (gralloc != NULL); | ||
| assert (_nativewindow == NULL); | ||
| _nativewindow = new FbDevNativeWindow(alloc, framebuffer); | ||
| _nativewindow->common.incRef(&_nativewindow->common); | ||
| - return (EGLNativeWindowType) static_cast<struct ANativeWindow *>(_nativewindow); | ||
| + struct _EGLNativeWindowType* type = new struct _EGLNativeWindowType; | ||
| + type->win = (EGLNativeWindowType) static_cast<struct ANativeWindow *>(_nativewindow); | ||
| + return type; | ||
| } | ||
| -extern "C" void fbdevws_DestroyWindow(EGLNativeWindowType win) | ||
| +extern "C" void fbdevws_DestroyWindow(struct _EGLNativeWindowType *win) | ||
| { | ||
| assert (_nativewindow != NULL); | ||
| assert (static_cast<FbDevNativeWindow *>((struct ANativeWindow *)win) == _nativewindow); | ||
| _nativewindow->common.decRef(&_nativewindow->common); | ||
| /* We are done with it, refcounting will delete the window when appropriate */ | ||
| _nativewindow = NULL; | ||
| + delete win; | ||
| } | ||
| extern "C" __eglMustCastToProperFunctionPointerType fbdevws_eglGetProcAddress(const char *procname) | ||
| { | ||
| return eglplatformcommon_eglGetProcAddress(procname); | ||
| } | ||
| -extern "C" void fbdevws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list) | ||
| +extern "C" void fbdevws_passthroughImageKHR(_EGLDisplay* display, EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list) | ||
| { | ||
| - eglplatformcommon_passthroughImageKHR(ctx, target, buffer, attrib_list); | ||
| + eglplatformcommon_passthroughImageKHR(display, ctx, target, buffer, attrib_list); | ||
| } | ||
| -extern "C" void fbdevws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval) | ||
| +extern "C" void fbdevws_setSwapInterval(EGLDisplay dpy, _EGLNativeWindowType* win, EGLint interval) | ||
| { | ||
| - FbDevNativeWindow *window = static_cast<FbDevNativeWindow *>((struct ANativeWindow *)win); | ||
| + FbDevNativeWindow *window = static_cast<FbDevNativeWindow *>((struct ANativeWindow *)win->win); | ||
| window->setSwapInterval(interval); | ||
| } | ||
View
14
hybris/egl/platforms/hwcomposer/eglplatform_hwcomposer.cpp
| @@ -52,7 +52,7 @@ extern "C" void hwcomposerws_Terminate(_EGLDisplay *dpy) | ||
| delete dpy; | ||
| } | ||
| -extern "C" EGLNativeWindowType hwcomposerws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display) | ||
| +extern "C" struct _EGLNativeWindowType *hwcomposerws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display, EGLConfig) | ||
| { | ||
| assert (gralloc != NULL); | ||
| assert (_nativewindow == NULL); | ||
| @@ -61,27 +61,31 @@ extern "C" EGLNativeWindowType hwcomposerws_CreateWindow(EGLNativeWindowType win | ||
| window->setup(gralloc, alloc); | ||
| _nativewindow = window; | ||
| _nativewindow->common.incRef(&_nativewindow->common); | ||
| - return (EGLNativeWindowType) static_cast<struct ANativeWindow *>(_nativewindow); | ||
| + struct _EGLNativeWindowType* type = new struct _EGLNativeWindowType; | ||
| + type->win = (EGLNativeWindowType) static_cast<struct ANativeWindow *>(_nativewindow); | ||
| + return type; | ||
| + | ||
| } | ||
| -extern "C" void hwcomposerws_DestroyWindow(EGLNativeWindowType win) | ||
| +extern "C" void hwcomposerws_DestroyWindow(struct _EGLNativeWindowType* win) | ||
| { | ||
| assert (_nativewindow != NULL); | ||
| assert (static_cast<HWComposerNativeWindow *>((struct ANativeWindow *)win) == _nativewindow); | ||
| _nativewindow->common.decRef(&_nativewindow->common); | ||
| /* We are done with it, refcounting will delete the window when appropriate */ | ||
| _nativewindow = NULL; | ||
| + delete win; | ||
| } | ||
| extern "C" __eglMustCastToProperFunctionPointerType hwcomposerws_eglGetProcAddress(const char *procname) | ||
| { | ||
| return eglplatformcommon_eglGetProcAddress(procname); | ||
| } | ||
| -extern "C" void hwcomposerws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list) | ||
| +extern "C" void hwcomposerws_passthroughImageKHR(_EGLDisplay* dpy, EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list) | ||
| { | ||
| - eglplatformcommon_passthroughImageKHR(ctx, target, buffer, attrib_list); | ||
| + eglplatformcommon_passthroughImageKHR(dpy, ctx, target, buffer, attrib_list); | ||
| } | ||
| struct ws_module ws_module_info = { | ||
View
17
hybris/egl/platforms/mir/Makefile.am
| @@ -0,0 +1,17 @@ | ||
| +pkglib_LTLIBRARIES = eglplatform_mir.la | ||
| + | ||
| +eglplatform_mir_la_SOURCES = eglplatform_mir.cpp | ||
| +eglplatform_mir_la_CXXFLAGS = \ | ||
| + -I$(top_srcdir)/egl \ | ||
| + -I$(top_srcdir)/include \ | ||
| + -I$(top_srcdir)/common \ | ||
| + -I$(top_srcdir)/include \ | ||
| + -I$(top_srcdir)/egl \ | ||
| + -I$(top_srcdir)/egl/platforms/common \ | ||
| + $(ANDROID_HEADERS_CFLAGS) \ | ||
| + $(MIR_CLIENT_CFLAGS) | ||
| + | ||
| +eglplatform_mir_la_LDFLAGS = \ | ||
| + -avoid-version -module -shared -export-dynamic \ | ||
| + $(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \ | ||
| + $(top_builddir)/hardware/libhardware.la |
Oops, something went wrong.