summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nv30_state.c
diff options
context:
space:
mode:
authorBen Skeggs <darktama@iinet.net.au>2006-12-23 23:51:24 +1100
committerBen Skeggs <darktama@iinet.net.au>2006-12-23 23:51:24 +1100
commitcb6a400dcd26089101c8a29a4eee198bd7ad9a58 (patch)
tree5f2b6137442afaad3bff407f2a7f85df36ad27bf /src/mesa/drivers/dri/nouveau/nv30_state.c
parentae8d8d132600cc544b7295c9554e6531bdbd8094 (diff)
nouveau: maintain numClipRects/pClipRects in context.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv30_state.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv30_state.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c
index 35b428b37c..7ccf5f9875 100644
--- a/src/mesa/drivers/dri/nouveau/nv30_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv30_state.c
@@ -575,19 +575,15 @@ static void nv30Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
nouveau_renderbuffer *nrb;
- /* Adjust offsets if drawing to a window */
- nrb = nouveau_current_draw_buffer(ctx);
- if (nrb && nrb->dPriv) {
- x += nrb->dPriv->x;
- y += nrb->dPriv->y;
- }
-
/* There's no scissor enable bit, so adjust the scissor to cover the
* maximum draw buffer bounds
*/
if (!ctx->Scissor.Enabled) {
x = y = 0;
w = h = 4095;
+ } else {
+ x += nmesa->drawX;
+ y += nmesa->drawY;
}
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2);
@@ -685,15 +681,8 @@ static void nv30WindowMoved(nouveauContextPtr nmesa)
GLfloat *v = nmesa->viewport.m;
GLuint w = ctx->Viewport.Width;
GLuint h = ctx->Viewport.Height;
- GLuint x = ctx->Viewport.X;
- GLuint y = ctx->Viewport.Y;
-
- /* Adjust offsets if drawing to a window */
- nrb = nouveau_current_draw_buffer(ctx);
- if (nrb && nrb->dPriv) {
- x += nrb->dPriv->x;
- y += nrb->dPriv->y;
- }
+ GLuint x = ctx->Viewport.X + nmesa->drawX;
+ GLuint y = ctx->Viewport.Y + nmesa->drawY;
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_0, 2);
OUT_RING_CACHE((w << 16) | x);
@@ -773,17 +762,10 @@ static GLboolean nv30BindBuffers(nouveauContextPtr nmesa, int num_color,
nouveau_renderbuffer *nrb;
GLuint x, y, w, h;
- /* Adjust offsets if drawing to a window */
- nrb = nouveau_current_draw_buffer(nmesa->glCtx);
w = nrb->mesa.Width;
h = nrb->mesa.Height;
- if (nrb && nrb->dPriv) {
- x = nrb->dPriv->x;
- y = nrb->dPriv->y;
- } else {
- x = 0;
- y = 0;
- }
+ x = nmesa->drawX;
+ y = nmesa->drawY;
if (num_color != 1)
return GL_FALSE;