[Mesa-dev] [PATCH 3/3] egl_dri2: add pbuffer support to platform_android
Chia-I Wu
olvaffe at gmail.com
Sun Aug 28 08:39:14 PDT 2011
From: Chia-I Wu <olv at lunarg.com>
This is a simple change thanks to allocateBuffer.
---
src/egl/drivers/dri2/platform_android.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 7b6730a..759f9f6 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -222,7 +222,8 @@ static _EGLSurface *
droid_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
- return NULL;
+ return droid_create_surface(drv, disp, EGL_PBUFFER_BIT, conf,
+ NULL, attrib_list);
}
static EGLBoolean
@@ -401,8 +402,10 @@ droid_get_buffers_parse_attachments(struct dri2_egl_surface *dri2_surf,
if (buf->name)
num_buffers++;
+
+ break;
}
- break;
+ /* fall through for pbuffers */
case __DRI_BUFFER_DEPTH:
case __DRI_BUFFER_STENCIL:
case __DRI_BUFFER_ACCUM:
@@ -473,6 +476,7 @@ static EGLBoolean
droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
const struct {
int format;
int size;
@@ -495,7 +499,7 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
struct dri2_egl_config *dri2_conf;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
- count + 1, visuals[i].size, EGL_WINDOW_BIT, NULL,
+ count + 1, visuals[i].size, surface_type, NULL,
visuals[i].rgba_masks);
if (dri2_conf) {
dri2_conf->base.NativeVisualID = visuals[i].format;
@@ -521,7 +525,7 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
/* and we want to make sure GL_DRAW_BUFFER is always GL_BACK */
if (!dri2_conf->dri_double_config)
- dri2_conf->base.SurfaceType &= ~EGL_WINDOW_BIT;
+ dri2_conf->base.SurfaceType &= ~surface_type;
}
return (count != 0);
--
1.7.5.4
More information about the mesa-dev
mailing list