minor code simplification
authorBrian <brian.paul@tungstengraphics.com>
Mon, 29 Oct 2007 21:08:43 +0000 (15:08 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 29 Oct 2007 21:15:34 +0000 (15:15 -0600)
src/mesa/pipe/softpipe/sp_surface.c

index c18fe56..3aa72ef 100644 (file)
@@ -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;