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/r300/radeon_context.c | |
parent | df3d4e0bb9ce40b3380734cf4f209a7363d5dcfd (diff) |
Dave Reveman's patch for GLX_MESA_copy_sub_buffer support
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_context.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_context.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 0a957816db..4e351dd66b 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -231,7 +231,7 @@ void radeonSwapBuffers(__DRIdrawablePrivate * dPriv) if (radeon->doPageFlip) { radeonPageFlip(dPriv); } else { - radeonCopyBuffer(dPriv); + radeonCopyBuffer(dPriv, NULL); } } } else { @@ -241,6 +241,31 @@ void 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__); + } +} /* Force the context `c' to be the current context and associate with it * buffer `b'. |