diff options
author | Kristian Høgsberg <krh@redhat.com> | 2009-03-06 21:13:44 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2009-03-06 21:13:44 -0500 |
commit | 5176cff74f132f7b0583a16124bd56ab72450ca7 (patch) | |
tree | 91b61a1122ea27dfd53b3b4c47b3a5192e4d84c2 | |
parent | c21f18146dad6962527cf2f0a45b1f824c0a1596 (diff) |
Add eglGetNativeBuffer to get the GEM buffer for a GL buffer.
-rw-r--r-- | eagle.h | 3 | ||||
-rw-r--r-- | intel.c | 20 |
2 files changed, 23 insertions, 0 deletions
@@ -256,6 +256,9 @@ extern EGLSurface eglCreateSurfaceForName(EGLDisplay dpy, GLuint stride, const EGLint *attribList); +extern EGLBoolean eglGetNativeBuffer(EGLSurface surface, GLenum buffer, + uint32_t *name, uint32_t *stride); + extern EGLBoolean eglCopyNativeBuffers(EGLDisplay display, EGLSurface dst, GLenum dstBuffer, GLint dst_x, GLint dst_y, @@ -233,6 +233,26 @@ intelCreateDisplay(struct udev_device *device, const char *driver) return display; } +EGLBoolean +eglGetNativeBuffer(EGLSurface surface, GLenum buffer, + uint32_t *name, uint32_t *stride) +{ + EGLSurfaceNative nativeSurface = (EGLSurfaceNative) surface; + + switch (buffer) { + case GL_FRONT_LEFT: + *name = nativeSurface->front.name; + *stride = nativeSurface->front.pitch; + return EGL_TRUE; + case GL_BACK_LEFT: + *name = surface->buffers[0].name; + *stride = surface->buffers[0].pitch; + return EGL_TRUE; + default: + return EGL_FALSE; + } +} + EGLDisplay i915CreateDisplay(struct udev_device *device) { |