[Mesa-dev] [PATCH 1/2] glapi/glx: Simplify __glXReadPixelReply

Matt Turner mattst88 at gmail.com
Thu Jul 19 08:29:26 PDT 2012


On Thu, Jul 19, 2012 at 7:46 AM, Julien Cristau <jcristau at debian.org> wrote:
> From: Julien Cristau <julien.cristau at logilab.fr>
>
> Doing
>         size = reply.length * 4;
>         [...]
>         extra = 4 - (size & 3);
>
> is useless, size & 3 will always be 0.
>
> Signed-off-by: Julien Cristau <julien.cristau at logilab.fr>
> ---
>  src/mapi/glapi/gen/glX_proto_send.py |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
> index bec0222..9068a61 100644
> --- a/src/mapi/glapi/gen/glX_proto_send.py
> +++ b/src/mapi/glapi/gen/glX_proto_send.py
> @@ -246,12 +246,7 @@ __glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim,
>              __glXSetError(gc, GL_OUT_OF_MEMORY);
>          }
>          else {
> -            const GLint extra = 4 - (size & 3);
> -
>              _XRead(dpy, buf, size);
> -            if ( extra < 4 ) {
> -                _XEatData(dpy, extra);
> -            }
>
>              __glEmptyImage(gc, 3, width, height, depth, format, type,
>                             buf, dest);
> --
> 1.7.2.5

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list