renderpix.c revision 4642e01f
14642e01fSmrg/*
24642e01fSmrg * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
34642e01fSmrg * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
44642e01fSmrg *
54642e01fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
64642e01fSmrg * copy of this software and associated documentation files (the "Software"),
74642e01fSmrg * to deal in the Software without restriction, including without limitation
84642e01fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
94642e01fSmrg * and/or sell copies of the Software, and to permit persons to whom the
104642e01fSmrg * Software is furnished to do so, subject to the following conditions:
114642e01fSmrg *
124642e01fSmrg * The above copyright notice including the dates of first publication and
134642e01fSmrg * either this permission notice or a reference to
144642e01fSmrg * http://oss.sgi.com/projects/FreeB/
154642e01fSmrg * shall be included in all copies or substantial portions of the Software.
164642e01fSmrg *
174642e01fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
184642e01fSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
194642e01fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
204642e01fSmrg * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
214642e01fSmrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
224642e01fSmrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
234642e01fSmrg * SOFTWARE.
244642e01fSmrg *
254642e01fSmrg * Except as contained in this notice, the name of Silicon Graphics, Inc.
264642e01fSmrg * shall not be used in advertising or otherwise to promote the sale, use or
274642e01fSmrg * other dealings in this Software without prior written authorization from
284642e01fSmrg * Silicon Graphics, Inc.
294642e01fSmrg */
304642e01fSmrg
314642e01fSmrg#define NEED_REPLIES
324642e01fSmrg#ifdef HAVE_DIX_CONFIG_H
334642e01fSmrg#include <dix-config.h>
344642e01fSmrg#endif
354642e01fSmrg
364642e01fSmrg#include "glxserver.h"
374642e01fSmrg#include "unpack.h"
384642e01fSmrg#include "indirect_dispatch.h"
394642e01fSmrg#include "glapitable.h"
404642e01fSmrg#include "glapi.h"
414642e01fSmrg#include "glthread.h"
424642e01fSmrg#include "dispatch.h"
434642e01fSmrg
444642e01fSmrgvoid __glXDisp_SeparableFilter2D(GLbyte *pc)
454642e01fSmrg{
464642e01fSmrg   __GLXdispatchConvolutionFilterHeader *hdr =
474642e01fSmrg				(__GLXdispatchConvolutionFilterHeader *) pc;
484642e01fSmrg    GLint hdrlen, image1len;
494642e01fSmrg
504642e01fSmrg    hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
514642e01fSmrg
524642e01fSmrg    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );
534642e01fSmrg    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );
544642e01fSmrg    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, hdr->rowLength) );
554642e01fSmrg    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, hdr->skipRows) );
564642e01fSmrg    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, hdr->skipPixels) );
574642e01fSmrg    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, hdr->alignment) );
584642e01fSmrg
594642e01fSmrg    /* XXX check this usage - internal code called
604642e01fSmrg    ** a version without the packing parameters
614642e01fSmrg    */
624642e01fSmrg    image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
634642e01fSmrg			       0, hdr->rowLength, 0, hdr->skipRows,
644642e01fSmrg			       hdr->alignment);
654642e01fSmrg    image1len = __GLX_PAD(image1len);
664642e01fSmrg
674642e01fSmrg    CALL_SeparableFilter2D( GET_DISPATCH(), (hdr->target, hdr->internalformat,
684642e01fSmrg		 hdr->width, hdr->height, hdr->format, hdr->type,
694642e01fSmrg		 ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len)) );
704642e01fSmrg}
71