From 8b2f997af572dd3aca00c4888adf2b0a60656331 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Oct 2007 15:08:43 -0600 Subject: [PATCH] minor code simplification --- src/mesa/pipe/softpipe/sp_surface.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c index c18fe56f899..3aa72ef569b 100644 --- a/src/mesa/pipe/softpipe/sp_surface.c +++ b/src/mesa/pipe/softpipe/sp_surface.c @@ -509,19 +509,18 @@ softpipe_get_tile(struct pipe_context *pipe, void *p, int dst_stride) { const uint cpp = ps->region->cpp; - const uint w0 = w; const ubyte *pSrc; ubyte *pDest; uint i; assert(ps->region->map); - CLIP_TILE; - if (dst_stride == 0) { - dst_stride = w0 * cpp; + dst_stride = w * cpp; } + CLIP_TILE; + pSrc = ps->region->map + ps->offset + (y * ps->region->pitch + x) * cpp; pDest = (ubyte *) p; @@ -543,19 +542,18 @@ softpipe_put_tile(struct pipe_context *pipe, const void *p, int src_stride) { const uint cpp = ps->region->cpp; - const uint w0 = w; const ubyte *pSrc; ubyte *pDest; uint i; assert(ps->region->map); - CLIP_TILE; - if (src_stride == 0) { - src_stride = w0 * cpp; + src_stride = w * cpp; } + CLIP_TILE; + pSrc = (const ubyte *) p; pDest = ps->region->map + ps->offset + (y * ps->region->pitch + x) * cpp; -- 2.30.2