[Mesa-dev] [PATCH 3/3] egl_dri2: add pbuffer support to platform_android

Chad Versace chad at chad-versace.us
Tue Aug 30 15:50:14 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/28/2011 08:39 AM, Chia-I Wu wrote:
> From: Chia-I Wu <olv at lunarg.com>
> 
> This is a simple change thanks to allocateBuffer.

Wow, adding pbuffer support was short and simple.

> ---
>  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;

I think (but I'm not certain) that the last fixup is equivalent to:
            dri2_conf->base.SurfaceType = 0;
If it is, then the code should just set SurfaceType = 0.

Other than that, the patch looks good.
Reviewed-by: Chad Versace <chad at chad-versace.us>

>     }
>  
>     return (count != 0);
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOXWkmAAoJEAIvNt057x8ifRAP/R9D0bfH9xz1Cr8yNbMAT27O
yXK8gYNfR23A2GGnrFf6ObFjgGxD6c5qMh8yi71DVLpY6dxRibUaARE3OQn6W6w/
p8+Fg5xkTbGay4qt6uDS0JL5xCwfk7GI/1jykMzQjTWwRka0kJVw/6uVM3rTbZxQ
Vf5lb30oE3amBiiVAiIZpoAdKpHpuM/4zxgGvTXmJ9K6/gyvPsYWnQWYnjkBTzHq
DTlylQbKMuJd/qCAlddxx3PmyEhfi4sY70QAVJg7OMy/6DkGdyh2xFbd6ggYxIUv
fvUoAxuHbEkVHecrDqQqFk23SPRga5aG4vTuiPNddbB+GbWpginea2M9KIW04qIK
2W242H01EUxeouosOKzsJh9AT6RoJURHdtIG4vyi4HIBJ4N68Q3zFtMIklsqurKF
XqcHjEnWrfvh2Z/sCKIWWLwvWPOIi9oYU8y/EWbVxN7z8+DSSlCW//IAQvnlr0MC
ag4Q4pGD0foRU17d0RKB20mC1+9ogXuXSaIPIVh0iCYquGngaV8zSHhj7t9reIGA
bggXIGDGHpaL+q6BzI0Sjjju9YTbW1OtsfkGB9x5sh80bJ+TwxgeE/rSIWv+DrZR
hkpQPxFFUpk7z2RXqL3S1c680a28UcHaeYkphnZnJGRm2+8aJFfnqZHeJJlcMrj3
ko9658xNbu6lTXfAeT5L
=xgvk
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list