summaryrefslogtreecommitdiff
path: root/opengl/libagl/egl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/libagl/egl.cpp')
-rw-r--r--opengl/libagl/egl.cpp28
1 files changed, 28 insertions, 0 deletions
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<egl_surface_t*>(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();
+}