diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-03-31 15:48:04 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-03-31 15:48:04 +0000 |
commit | f2ad1b60c0da11283b399008f491792790cea294 (patch) | |
tree | ed81cb738dd06f961713fb9e34827a3b57832cca /src/mesa/drivers/dri/radeon/radeon_context.c | |
parent | df3d4e0bb9ce40b3380734cf4f209a7363d5dcfd (diff) |
Dave Reveman's patch for GLX_MESA_copy_sub_buffer support
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 27 |
1 files changed, 26 insertions, 1 deletions
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. |