aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/unichrome/via_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/unichrome/via_context.c')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index 89533421b46..4d25d328e33 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -768,9 +768,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa)
drawable);
}
- draw_buffer->drawXoff = (GLuint)(((drawable->x * bytePerPixel) & 0x1f) /
- bytePerPixel);
- draw_buffer->drawX = drawable->x - draw_buffer->drawXoff;
+ draw_buffer->drawX = drawable->x;
draw_buffer->drawY = drawable->y;
draw_buffer->drawW = drawable->w;
draw_buffer->drawH = drawable->h;
@@ -782,9 +780,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa)
readable);
}
- read_buffer->drawXoff = (GLuint)(((readable->x * bytePerPixel) & 0x1f) /
- bytePerPixel);
- read_buffer->drawX = readable->x - read_buffer->drawXoff;
+ read_buffer->drawX = readable->x;
read_buffer->drawY = readable->y;
read_buffer->drawW = readable->w;
read_buffer->drawH = readable->h;
@@ -795,13 +791,24 @@ void viaXMesaWindowMoved(struct via_context *vmesa)
draw_buffer->drawX * bytePerPixel);
vmesa->front.origMap = (vmesa->front.map +
- draw_buffer->drawY * vmesa->front.pitch +
- draw_buffer->drawX * bytePerPixel);
+ draw_buffer->drawY * vmesa->front.pitch +
+ draw_buffer->drawX * bytePerPixel);
+
+ vmesa->back.orig = (vmesa->back.offset +
+ draw_buffer->drawY * vmesa->back.pitch +
+ draw_buffer->drawX * bytePerPixel);
- vmesa->back.orig = vmesa->back.offset;
- vmesa->depth.orig = vmesa->depth.offset;
- vmesa->back.origMap = vmesa->back.map;
- vmesa->depth.origMap = vmesa->depth.map;
+ vmesa->back.origMap = (vmesa->back.map +
+ draw_buffer->drawY * vmesa->back.pitch +
+ draw_buffer->drawX * bytePerPixel);
+
+ vmesa->depth.orig = (vmesa->depth.offset +
+ draw_buffer->drawY * vmesa->depth.pitch +
+ draw_buffer->drawX * bytePerPixel);
+
+ vmesa->depth.origMap = (vmesa->depth.map +
+ draw_buffer->drawY * vmesa->depth.pitch +
+ draw_buffer->drawX * bytePerPixel);
viaCalcViewport(vmesa->glCtx);
}