summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_pixel.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-09-01 04:03:44 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-09-01 04:03:44 +0000
commitfcbfeb5d28aea87c60f2d02daa213d0c0c2516e8 (patch)
tree783872f7936fc274c1786dd8a06e227494939c7a /src/mesa/drivers/dri/r200/r200_pixel.c
parent982e8e4d5c95e9e9040b4b70d7322a2a8a9396d9 (diff)
Finish up some of the gl_renderbuffer work.
Use driRenderbuffer's offset, pitch fields in the span routines. Remove the SetBuffer driver function. Consolidate the code for setting CTX_RB3D_COLOROFFSET and CTX_RB3D_COLORPITCH state in new radeonUpdateDrawBuffer() function. Old code is surrounded by #if 000 / #endif, temporarily.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_pixel.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_pixel.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c
index ad3ec20b4e..c3489b6c62 100644
--- a/src/mesa/drivers/dri/r200/r200_pixel.c
+++ b/src/mesa/drivers/dri/r200/r200_pixel.c
@@ -43,6 +43,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_pixel.h"
#include "r200_swtcl.h"
+#include "drirenderbuffer.h"
static GLboolean
@@ -213,10 +214,11 @@ r200TryReadPixels( GLcontext *ctx,
{
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ driRenderbuffer *drb = (driRenderbuffer *) ctx->ReadBuffer->_ColorReadBuffer;
int nbox = dPriv->numClipRects;
- int src_offset = rmesa->state.color.drawOffset
+ int src_offset = drb->offset
+ rmesa->r200Screen->fbLocation;
- int src_pitch = rmesa->state.color.drawPitch * rmesa->r200Screen->cpp;
+ int src_pitch = drb->pitch * drb->cpp;
int dst_offset = r200GartOffsetFromVirtual( rmesa, pixels );
int dst_pitch = pitch * rmesa->r200Screen->cpp;
drm_clip_rect_t *box = dPriv->pClipRects;
@@ -293,6 +295,8 @@ static void do_draw_pix( GLcontext *ctx,
r200ContextPtr rmesa = R200_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
drm_clip_rect_t *box = dPriv->pClipRects;
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorDrawBuffers[0][0];
+ driRenderbuffer *drb = (driRenderbuffer *) rb;
int nbox = dPriv->numClipRects;
int i;
int blit_format;
@@ -353,8 +357,8 @@ static void do_draw_pix( GLcontext *ctx,
r200EmitBlit( rmesa,
blit_format,
src_pitch, src_offset,
- rmesa->state.color.drawPitch * rmesa->r200Screen->cpp,
- rmesa->state.color.drawOffset + rmesa->r200Screen->fbLocation,
+ drb->pitch * drb->cpp,
+ drb->offset + rmesa->r200Screen->fbLocation,
bx - x, by - y,
bx, by,
bw, bh );
@@ -384,6 +388,10 @@ r200TryDrawPixels( GLcontext *ctx,
if (R200_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
+ /* check that we're drawing to exactly one color buffer */
+ if (ctx->DrawBuffer->_NumColorDrawBuffers[0] != 1)
+ return GL_FALSE;
+
switch (format) {
case GL_RGB:
case GL_RGBA: