From f2ad1b60c0da11283b399008f491792790cea294 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Mar 2006 15:48:04 +0000 Subject: Dave Reveman's patch for GLX_MESA_copy_sub_buffer support --- src/mesa/drivers/dri/radeon/radeon_context.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index f546731ad4..791d1a37bc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -572,7 +572,7 @@ radeonSwapBuffers( __DRIdrawablePrivate *dPriv ) radeonPageFlip( dPriv ); } else { - radeonCopyBuffer( dPriv ); + radeonCopyBuffer( dPriv, NULL ); } } } @@ -582,6 +582,31 @@ radeonSwapBuffers( __DRIdrawablePrivate *dPriv ) } } +void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, + int x, int y, int w, int h ) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + radeonContextPtr radeon; + GLcontext *ctx; + + radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; + ctx = radeon->glCtx; + + if (ctx->Visual.doubleBufferMode) { + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + radeonCopyBuffer(dPriv, &rect); + } + } else { + /* XXX this shouldn't be an error but we can't handle it for now */ + _mesa_problem(NULL, "%s: drawable has no context!", + __FUNCTION__); + } +} /* Make context `c' the current context and bind it to the given * drawing and reading surfaces. -- cgit v1.2.3