From f9752cc4cf4e4f36eaa6f19f607957b9eb496bc4 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Tue, 21 Aug 2012 22:22:02 -0700 Subject: egl: Reintroduce eglGetRenderBufferANDROID eglGetRenderBufferANDROID was removed as it had no users. This commit reintroduces this extensions as it's used by Qualcomm graphics HAL. Change-Id: I493306830a0d4f8722a42bcc84fb49236afdabeb --- opengl/libagl/egl.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'opengl/libagl/egl.cpp') diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index c31aebf282..232c84ffac 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -165,6 +165,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; }; @@ -208,6 +209,9 @@ EGLBoolean egl_surface_t::setSwapRectangle( { return EGL_FALSE; } +EGLClientBuffer egl_surface_t::getRenderBuffer() const { + return 0; +} // ---------------------------------------------------------------------------- @@ -233,6 +237,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(ANativeWindowBuffer* buf, int usage, void** vaddr); @@ -571,6 +576,11 @@ EGLBoolean egl_window_surface_v2_t::setSwapRectangle( return EGL_TRUE; } +EGLClientBuffer egl_window_surface_v2_t::getRenderBuffer() const +{ + return buffer; +} + EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl) { GGLSurface buffer; @@ -801,6 +811,7 @@ static char const * const gExtensionsString = // "KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " + "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- @@ -861,6 +872,8 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&eglGetSyncAttribKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, + { "eglGetRenderBufferANDROID", + (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; /* @@ -2154,3 +2167,18 @@ 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(draw); + if (!d->isValid()) + return setError(EGL_BAD_SURFACE, (EGLClientBuffer)0); + if (d->dpy != dpy) + return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); + + // post the surface + return d->getRenderBuffer(); +} -- cgit v1.2.3-59-g8ed1b