Пример #1
0
int
__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
{
    __GLXdispatchConvolutionFilterHeader *hdr =
        (__GLXdispatchConvolutionFilterHeader *) pc;

    GLint image1size, image2size;
    GLenum format = hdr->format;
    GLenum type = hdr->type;
    GLint w = hdr->width;
    GLint h = hdr->height;
    GLint rowLength = hdr->rowLength;
    GLint alignment = hdr->alignment;

    if (swap) {
        format = SWAPL(format);
        type = SWAPL(type);
        w = SWAPL(w);
        h = SWAPL(h);
        rowLength = SWAPL(rowLength);
        alignment = SWAPL(alignment);
    }

    /* XXX Should rowLength be used for either or both image? */
    image1size = __glXImageSize(format, type, 0, w, 1, 1,
                                0, rowLength, 0, 0, alignment);
    image2size = __glXImageSize(format, type, 0, h, 1, 1,
                                0, rowLength, 0, 0, alignment);
    return safe_add(safe_pad(image1size), image2size);
}
Пример #2
0
int
__glXTexSubImage3DReqSize( const GLbyte * pc, Bool swap )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = *  (GLint *)(pc +  8);
    GLint skip_rows    = *  (GLint *)(pc + 16);
    GLint skip_images  = *  (GLint *)(pc + 20);
    GLint alignment    = *  (GLint *)(pc + 32);
GLenum target      = * (GLenum *)(pc + 36);
GLsizei width      = *(GLsizei *)(pc + 60);
GLsizei height     = *(GLsizei *)(pc + 64);
GLsizei depth      = *(GLsizei *)(pc + 68);
GLenum format      = * (GLenum *)(pc + 76);
GLenum type        = * (GLenum *)(pc + 80);

    if (swap) {
        row_length = bswap_32(row_length);
        image_height = bswap_32(image_height);
        skip_rows = bswap_32(skip_rows);
        skip_images = bswap_32(skip_images);
        alignment = bswap_32(alignment);
        target = bswap_32(target);
        width = bswap_32(width);
        height = bswap_32(height);
        depth = bswap_32(depth);
        format = bswap_32(format);
        type = bswap_32(type);
    }

    return __glXImageSize(format, type, target, width, height, depth,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
Пример #3
0
int
__glXConvolutionFilter2DReqSize( const GLbyte * pc, Bool swap )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = 0;
    GLint skip_images  = 0;
    GLint skip_rows    = *  (GLint *)(pc +  8);
    GLint alignment    = *  (GLint *)(pc + 16);
GLenum target      = * (GLenum *)(pc + 20);
GLsizei width      = *(GLsizei *)(pc + 28);
GLsizei height     = *(GLsizei *)(pc + 32);
GLenum format      = * (GLenum *)(pc + 36);
GLenum type        = * (GLenum *)(pc + 40);

    if (swap) {
        row_length = bswap_32(row_length);
        skip_rows = bswap_32(skip_rows);
        alignment = bswap_32(alignment);
        target = bswap_32(target);
        width = bswap_32(width);
        height = bswap_32(height);
        format = bswap_32(format);
        type = bswap_32(type);
    }

    return __glXImageSize(format, type, target, width, height, 1,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
Пример #4
0
int
__glXColorSubTableReqSize( const GLbyte * pc, Bool swap )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = 0;
    GLint skip_images  = 0;
    GLint skip_rows    = *  (GLint *)(pc +  8);
    GLint alignment    = *  (GLint *)(pc + 16);
GLenum target      = * (GLenum *)(pc + 20);
GLsizei count      = *(GLsizei *)(pc + 28);
GLenum format      = * (GLenum *)(pc + 32);
GLenum type        = * (GLenum *)(pc + 36);

    if (swap) {
        row_length = bswap_32(row_length);
        skip_rows = bswap_32(skip_rows);
        alignment = bswap_32(alignment);
        target = bswap_32(target);
        count = bswap_32(count);
        format = bswap_32(format);
        type = bswap_32(type);
    }

    return __glXImageSize(format, type, target, count, 1, 1,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
Пример #5
0
int
__glXTexSubImage1DReqSize( const GLbyte * pc, Bool swap, int reqlen )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = 0;
    GLint skip_images  = 0;
    GLint skip_rows    = *  (GLint *)(pc +  8);
    GLint alignment    = *  (GLint *)(pc + 16);
GLenum target      = * (GLenum *)(pc + 20);
GLsizei width      = *(GLsizei *)(pc + 36);
GLenum format      = * (GLenum *)(pc + 44);
GLenum type        = * (GLenum *)(pc + 48);

    if (swap) {
        row_length = bswap_32(row_length);
        skip_rows = bswap_32(skip_rows);
        alignment = bswap_32(alignment);
        target = bswap_32(target);
        width = bswap_32(width);
        format = bswap_32(format);
        type = bswap_32(type);
    }

    return __glXImageSize(format, type, target, width, 1, 1,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
Пример #6
0
int
__glXDrawPixelsReqSize( const GLbyte * pc, Bool swap, int reqlen )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = 0;
    GLint skip_images  = 0;
    GLint skip_rows    = *  (GLint *)(pc +  8);
    GLint alignment    = *  (GLint *)(pc + 16);
GLsizei width      = *(GLsizei *)(pc + 20);
GLsizei height     = *(GLsizei *)(pc + 24);
GLenum format      = * (GLenum *)(pc + 28);
GLenum type        = * (GLenum *)(pc + 32);

    if (swap) {
        row_length = bswap_32(row_length);
        skip_rows = bswap_32(skip_rows);
        alignment = bswap_32(alignment);
        width = bswap_32(width);
        height = bswap_32(height);
        format = bswap_32(format);
        type = bswap_32(type);
    }

    return __glXImageSize(format, type, 0, width, height, 1,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
{
    __GLXdispatchConvolutionFilterHeader *hdr =
				(__GLXdispatchConvolutionFilterHeader *) pc;
    GLint hdrlen, image1len;
    __GLX_DECLARE_SWAP_VARIABLES;

    hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);

    __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
    __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
    __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
    __GLX_SWAP_INT((GLbyte *)&hdr->alignment);

    __GLX_SWAP_INT((GLbyte *)&hdr->target);
    __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
    __GLX_SWAP_INT((GLbyte *)&hdr->width);
    __GLX_SWAP_INT((GLbyte *)&hdr->height);
    __GLX_SWAP_INT((GLbyte *)&hdr->format);
    __GLX_SWAP_INT((GLbyte *)&hdr->type);

    /*
    ** Just invert swapBytes flag; the GL will figure out if it needs to swap
    ** the pixel data.
    */
    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, !hdr->swapBytes) );
    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );
    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, hdr->rowLength) );
    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, hdr->skipRows) );
    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, hdr->skipPixels) );
    CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, hdr->alignment) );

    /* XXX check this usage - internal code called
    ** a version without the packing parameters
    */
    image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
			       0, hdr->rowLength, 0, hdr->skipRows,
			       hdr->alignment);
    image1len = __GLX_PAD(image1len);


    CALL_SeparableFilter2D( GET_DISPATCH(), (hdr->target, hdr->internalformat,
		 hdr->width, hdr->height, hdr->format, hdr->type,
		 ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len)) );
}
Пример #8
0
int
__glXPolygonStippleReqSize( const GLbyte * pc, Bool swap )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = 0;
    GLint skip_images  = 0;
    GLint skip_rows    = *  (GLint *)(pc +  8);
    GLint alignment    = *  (GLint *)(pc + 16);

    if (swap) {
        row_length = bswap_32(row_length);
        skip_rows = bswap_32(skip_rows);
        alignment = bswap_32(alignment);
    }

    return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
Пример #9
0
int
__glXBitmapReqSize( const GLbyte * pc, Bool swap )
{
    GLint row_length   = *  (GLint *)(pc +  4);
    GLint image_height = 0;
    GLint skip_images  = 0;
    GLint skip_rows    = *  (GLint *)(pc +  8);
    GLint alignment    = *  (GLint *)(pc + 16);
GLsizei width      = *(GLsizei *)(pc + 20);
GLsizei height     = *(GLsizei *)(pc + 24);

    if (swap) {
        row_length = bswap_32(row_length);
        skip_rows = bswap_32(skip_rows);
        alignment = bswap_32(alignment);
        width = bswap_32(width);
        height = bswap_32(height);
    }

    return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1,
                          image_height, row_length, skip_images,
                          skip_rows, alignment);
}
Пример #10
0
GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h)
{
    return __glXImageSize( format, type, 0, w, h, 1, 0, 0, 0, 0, 4 );
}
Пример #11
0
GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
			   GLenum type, GLint width, GLint height, GLint depth)
{
    return __glXImageSize( format, type, target, width, height, depth,
			   0, 0, 0, 0, 4 );
}