/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
struct gl_buffer_object *bufferSave;
return;
}
- /* Select buffer to read from */
- _swrast_use_read_buffer(ctx);
-
if (width > MAX_WIDTH)
width = MAX_WIDTH;
+ RENDER_START( swrast, ctx );
+
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y, data );
+ width, x, y, CHAN_TYPE, data );
- /* Restore reading from draw buffer (the default) */
- _swrast_use_draw_buffer(ctx);
+ RENDER_FINISH(swrast,ctx);
/* save PBO binding */
bufferSave = ctx->Unpack.BufferObj;
_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
struct gl_buffer_object *bufferSave;
return;
}
- /* Select buffer to read from */
- _swrast_use_read_buffer(ctx);
-
if (width > MAX_WIDTH)
width = MAX_WIDTH;
+ RENDER_START( swrast, ctx );
+
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y, data );
+ width, x, y, CHAN_TYPE, data );
- /* Restore reading from draw buffer (the default) */
- _swrast_use_draw_buffer(ctx);
+ RENDER_FINISH(swrast,ctx);
/* save PBO binding */
bufferSave = ctx->Unpack.BufferObj;
return;
}
- /* Select buffer to read from */
- _swrast_use_read_buffer(ctx);
-
RENDER_START( swrast, ctx );
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y, (GLchan (*)[4]) rgba );
+ width, x, y, CHAN_TYPE, rgba );
RENDER_FINISH( swrast, ctx );
- /* Restore reading from draw buffer (the default) */
- _swrast_use_draw_buffer(ctx);
-
/* save PBO binding */
bufferSave = ctx->Unpack.BufferObj;
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
return;
}
- /* Select buffer to read from */
- _swrast_use_read_buffer(ctx);
-
RENDER_START(swrast,ctx);
/* read pixels from framebuffer */
for (i = 0; i < height; i++) {
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y + i, (GLchan (*)[4]) rgba[i] );
+ width, x, y + i, CHAN_TYPE, rgba[i] );
}
RENDER_FINISH(swrast,ctx);
- /* Restore reading from draw buffer (the default) */
- _swrast_use_draw_buffer(ctx);
-
/*
* HACK: save & restore context state so we can store this as a
* convolution filter via the GL api. Doesn't call any callbacks