Loading opengl/include/EGL/eglext.h +14 −2 Original line number Diff line number Diff line Loading @@ -132,6 +132,20 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL #endif #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 struct android_native_buffer_t; #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif #ifndef EGL_ANDROID_get_render_buffer #define EGL_ANDROID_get_render_buffer 1 #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw); #endif typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw); #endif #ifndef EGL_ANDROID_swap_rectangle #define EGL_ANDROID_swap_rectangle 1 #ifdef EGL_EGLEXT_PROTOTYPES Loading @@ -141,8 +155,6 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay #endif #ifdef __cplusplus } #endif Loading opengl/include/EGL/eglplatform.h +0 −6 Original line number Diff line number Diff line Loading @@ -96,12 +96,6 @@ typedef struct android_native_window_t* EGLNativeWindowType; typedef struct egl_native_pixmap_t* EGLNativePixmapType; typedef void* EGLNativeDisplayType; #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 struct android_native_buffer_t; #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif #else #error "Platform not recognized" #endif Loading opengl/libagl/TextureObjectManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <GLES/gl.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include "Tokenizer.h" #include "TokenManager.h" Loading opengl/libagl/egl.cpp +39 −6 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ struct egl_surface_t virtual EGLint getSwapBehavior() const; virtual EGLBoolean swapBuffers(); virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); virtual EGLClientBuffer getRenderBuffer() const; protected: GGLSurface depth; }; Loading Loading @@ -196,6 +197,9 @@ EGLBoolean egl_surface_t::setSwapRectangle( { return EGL_FALSE; } EGLClientBuffer egl_surface_t::getRenderBuffer() const { return 0; } // ---------------------------------------------------------------------------- Loading @@ -221,6 +225,7 @@ struct egl_window_surface_v2_t : public egl_surface_t virtual EGLint getRefreshRate() const; virtual EGLint getSwapBehavior() const; virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); virtual EGLClientBuffer getRenderBuffer() const; private: status_t lock(android_native_buffer_t* buf, int usage, void** vaddr); Loading Loading @@ -524,18 +529,24 @@ EGLBoolean egl_window_surface_v2_t::setSwapRectangle( return EGL_TRUE; } EGLClientBuffer egl_window_surface_v2_t::getRenderBuffer() const { return buffer; } #ifdef LIBAGL_USE_GRALLOC_COPYBITS static bool supportedCopybitsDestinationFormat(int format) { // Hardware supported and no destination alpha // Hardware supported switch (format) { case HAL_PIXEL_FORMAT_RGB_565: case HAL_PIXEL_FORMAT_YCbCr_422_SP: case HAL_PIXEL_FORMAT_YCbCr_420_SP: case HAL_PIXEL_FORMAT_RGBA_8888: case HAL_PIXEL_FORMAT_RGBA_4444: case HAL_PIXEL_FORMAT_RGBA_5551: case HAL_PIXEL_FORMAT_BGRA_8888: return true; default: return false; } return false; } #endif Loading Loading @@ -778,6 +789,7 @@ static char const * const gExtensionsString = // "KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- Loading Loading @@ -824,6 +836,14 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&glDeleteBuffers }, { "glGenBuffers", (__eglMustCastToProperFunctionPointerType)&glGenBuffers }, { "eglCreateImageKHR", (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR }, { "eglDestroyImageKHR", (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, { "eglGetRenderBufferANDROID", (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; /* Loading Loading @@ -1984,3 +2004,16 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, return EGL_TRUE; } EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) { if (egl_display_t::is_valid(dpy) == EGL_FALSE) return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); egl_surface_t* d = static_cast<egl_surface_t*>(draw); if (d->dpy != dpy) return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); // post the surface return d->getRenderBuffer(); } opengl/libs/EGL/egl.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ static char const * const gExtensionString = "EGL_KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- Loading Loading @@ -303,6 +304,10 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR }, { "eglDestroyImageKHR", (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, { "eglGetRenderBufferANDROID", (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; static extention_map_t gGLExtentionMap[MAX_NUMBER_OF_GL_EXTENSIONS]; Loading Loading @@ -1484,3 +1489,15 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, return EGL_FALSE; } EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) { if (!validate_display_surface(dpy, draw)) return 0; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(draw); if (s->cnx->hooks->egl.eglGetRenderBufferANDROID) { return s->cnx->hooks->egl.eglGetRenderBufferANDROID(dp->dpys[s->impl], s->surface); } return 0; } Loading
opengl/include/EGL/eglext.h +14 −2 Original line number Diff line number Diff line Loading @@ -132,6 +132,20 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL #endif #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 struct android_native_buffer_t; #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif #ifndef EGL_ANDROID_get_render_buffer #define EGL_ANDROID_get_render_buffer 1 #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw); #endif typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw); #endif #ifndef EGL_ANDROID_swap_rectangle #define EGL_ANDROID_swap_rectangle 1 #ifdef EGL_EGLEXT_PROTOTYPES Loading @@ -141,8 +155,6 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay #endif #ifdef __cplusplus } #endif Loading
opengl/include/EGL/eglplatform.h +0 −6 Original line number Diff line number Diff line Loading @@ -96,12 +96,6 @@ typedef struct android_native_window_t* EGLNativeWindowType; typedef struct egl_native_pixmap_t* EGLNativePixmapType; typedef void* EGLNativeDisplayType; #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 struct android_native_buffer_t; #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif #else #error "Platform not recognized" #endif Loading
opengl/libagl/TextureObjectManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <GLES/gl.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include "Tokenizer.h" #include "TokenManager.h" Loading
opengl/libagl/egl.cpp +39 −6 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ struct egl_surface_t virtual EGLint getSwapBehavior() const; virtual EGLBoolean swapBuffers(); virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); virtual EGLClientBuffer getRenderBuffer() const; protected: GGLSurface depth; }; Loading Loading @@ -196,6 +197,9 @@ EGLBoolean egl_surface_t::setSwapRectangle( { return EGL_FALSE; } EGLClientBuffer egl_surface_t::getRenderBuffer() const { return 0; } // ---------------------------------------------------------------------------- Loading @@ -221,6 +225,7 @@ struct egl_window_surface_v2_t : public egl_surface_t virtual EGLint getRefreshRate() const; virtual EGLint getSwapBehavior() const; virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); virtual EGLClientBuffer getRenderBuffer() const; private: status_t lock(android_native_buffer_t* buf, int usage, void** vaddr); Loading Loading @@ -524,18 +529,24 @@ EGLBoolean egl_window_surface_v2_t::setSwapRectangle( return EGL_TRUE; } EGLClientBuffer egl_window_surface_v2_t::getRenderBuffer() const { return buffer; } #ifdef LIBAGL_USE_GRALLOC_COPYBITS static bool supportedCopybitsDestinationFormat(int format) { // Hardware supported and no destination alpha // Hardware supported switch (format) { case HAL_PIXEL_FORMAT_RGB_565: case HAL_PIXEL_FORMAT_YCbCr_422_SP: case HAL_PIXEL_FORMAT_YCbCr_420_SP: case HAL_PIXEL_FORMAT_RGBA_8888: case HAL_PIXEL_FORMAT_RGBA_4444: case HAL_PIXEL_FORMAT_RGBA_5551: case HAL_PIXEL_FORMAT_BGRA_8888: return true; default: return false; } return false; } #endif Loading Loading @@ -778,6 +789,7 @@ static char const * const gExtensionsString = // "KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- Loading Loading @@ -824,6 +836,14 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&glDeleteBuffers }, { "glGenBuffers", (__eglMustCastToProperFunctionPointerType)&glGenBuffers }, { "eglCreateImageKHR", (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR }, { "eglDestroyImageKHR", (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, { "eglGetRenderBufferANDROID", (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; /* Loading Loading @@ -1984,3 +2004,16 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, return EGL_TRUE; } EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) { if (egl_display_t::is_valid(dpy) == EGL_FALSE) return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); egl_surface_t* d = static_cast<egl_surface_t*>(draw); if (d->dpy != dpy) return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); // post the surface return d->getRenderBuffer(); }
opengl/libs/EGL/egl.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ static char const * const gExtensionString = "EGL_KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- Loading Loading @@ -303,6 +304,10 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR }, { "eglDestroyImageKHR", (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, { "eglGetRenderBufferANDROID", (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; static extention_map_t gGLExtentionMap[MAX_NUMBER_OF_GL_EXTENSIONS]; Loading Loading @@ -1484,3 +1489,15 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, return EGL_FALSE; } EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) { if (!validate_display_surface(dpy, draw)) return 0; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(draw); if (s->cnx->hooks->egl.eglGetRenderBufferANDROID) { return s->cnx->hooks->egl.eglGetRenderBufferANDROID(dp->dpys[s->impl], s->surface); } return 0; }