replace GET_SRC_PTR, GET_DST_PTR with GET_PTR
authorBrian Paul <brian.paul@tungstengraphics.com>
Sun, 4 Sep 2005 15:02:48 +0000 (15:02 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sun, 4 Sep 2005 15:02:48 +0000 (15:02 +0000)
src/mesa/drivers/dri/gamma/gamma_span.c
src/mesa/drivers/dri/mach64/mach64_span.c
src/mesa/drivers/dri/r128/r128_span.c
src/mesa/drivers/dri/r200/r200_span.c
src/mesa/drivers/dri/radeon/radeon_span.c
src/mesa/drivers/dri/unichrome/via_span.c

index 66cc961..f62bea9 100644 (file)
                        gmesa->drawOffset +                             \
                        (dPriv->x * gammascrn->cpp) +                   \
                        (dPriv->y * pitch));                            \
-   char *read_buf = (char *)(sPriv->pFB +                              \
-                            gmesa->readOffset +                        \
-                            (dPriv->x * gammascrn->cpp) +              \
-                            (dPriv->y * pitch));                       \
    GLuint p;                                                           \
-   (void) read_buf; (void) buf; (void) p
+   (void) buf; (void) p
 
 /* FIXME! Depth/Stencil read/writes don't work ! */
 #define LOCAL_DEPTH_VARS                               \
@@ -71,7 +67,7 @@
 
 #define READ_RGBA( rgba, _x, _y )                                      \
    do {                                                                        \
-      GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch);          \
+      GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch);               \
       rgba[0] = (p >> 8) & 0xf8;                                       \
       rgba[1] = (p >> 3) & 0xfc;                                       \
       rgba[2] = (p << 3) & 0xf8;                                       \
 
 #define READ_RGBA( rgba, _x, _y )                                      \
 do {                                                                   \
-   GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch);                 \
+   GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch);                      \
    rgba[0] = (p >> 16) & 0xff;                                         \
    rgba[1] = (p >>  8) & 0xff;                                         \
    rgba[2] = (p >>  0) & 0xff;                                         \
index dc9f27c..3830a28 100644 (file)
@@ -38,9 +38,6 @@
 
 #define DBG 0
 
-#define GET_PTR(X,Y) (sPriv->pFB + drb->offset         \
-     + ((dPriv->y + (Y)) * drb->pitch + (dPriv->x + (X))) * drb->cpp)
-
 #define LOCAL_VARS                                                     \
    mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);                       \
    __DRIscreenPrivate *sPriv = mmesa->driScreen;                       \
@@ -95,8 +92,8 @@
 
 #define TAG(x)    mach64##x##_RGB565
 #define TAG2(x,y) mach64##x##_RGB565##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X,Y)
-#define GET_DST_PTR(X,Y) GET_SRC_PTR(X,Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->offset         \
+     + ((dPriv->y + (Y)) * drb->pitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
 
 #define TAG(x)    mach64##x##_ARGB8888
 #define TAG2(x,y) mach64##x##_ARGB8888##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X,Y)
-#define GET_DST_PTR(X,Y) GET_SRC_PTR(X,Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->offset         \
+     + ((dPriv->y + (Y)) * drb->pitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
index e64282b..d204f4d 100644 (file)
@@ -44,9 +44,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define DBG 0
 
-#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
-     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
-
 #define HAVE_HW_DEPTH_SPANS    1
 #define HAVE_HW_DEPTH_PIXELS   1
 
@@ -88,8 +85,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define TAG(x)    r128##x##_RGB565
 #define TAG2(x,y) r128##x##_RGB565##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X,Y)
-#define GET_DST_PTR(X,Y) GET_PTR(X,Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
+     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
@@ -100,8 +97,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define TAG(x)    r128##x##_ARGB8888
 #define TAG2(x,y) r128##x##_ARGB8888##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X,Y)
-#define GET_DST_PTR(X,Y) GET_PTR(X,Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
+     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
index 8de4133..7cfed94 100644 (file)
@@ -46,9 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define DBG 0
 
-#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
-     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
-
 #define LOCAL_VARS                                                     \
    r200ContextPtr rmesa = R200_CONTEXT(ctx);                           \
    __DRIscreenPrivate *sPriv = rmesa->dri.screen;                      \
@@ -89,8 +86,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define TAG(x)    r200##x##_RGB565
 #define TAG2(x,y) r200##x##_RGB565##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X,Y)
-#define GET_DST_PTR(X,Y) GET_PTR(X,Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
+     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 /* 32 bit, ARGB8888 color spanline and pixel functions
@@ -100,8 +97,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define TAG(x)    r200##x##_ARGB8888
 #define TAG2(x,y) r200##x##_ARGB8888##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X,Y)
-#define GET_DST_PTR(X,Y) GET_PTR(X,Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
+     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
@@ -259,10 +256,10 @@ static void r200SpanRenderStart( GLcontext *ctx )
       int p;
       driRenderbuffer *drb =
         (driRenderbuffer *) ctx->WinSysDrawBuffer->_ColorDrawBuffers[0][0];
-      volatile int *read_buf =
+      volatile int *buf =
         (volatile int *)(rmesa->dri.screen->pFB + drb->offset);
-      p = *read_buf;
-      *read_buf = p;
+      p = *buf;
+      *buf = p;
    }
 }
 
index 5167bdd..05c4781 100644 (file)
@@ -50,8 +50,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define DBG 0
 
-#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
-     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 
 /*
  * Eventually, try to remove all references to ctx/rmesa here.
@@ -100,8 +98,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define TAG(x)    radeon##x##_RGB565
 #define TAG2(x,y) radeon##x##_RGB565##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X, Y)
-#define GET_DST_PTR(X,Y) GET_PTR(X, Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
+     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
@@ -112,8 +110,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define TAG(x)    radeon##x##_ARGB8888
 #define TAG2(x,y) radeon##x##_ARGB8888##y
-#define GET_SRC_PTR(X,Y) GET_PTR(X, Y)
-#define GET_DST_PTR(X,Y) GET_PTR(X, Y)
+#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset          \
+     + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
 #include "spantmp2.h"
 
 
@@ -251,7 +249,6 @@ do {                                                                        \
 static void radeonSpanRenderStart( GLcontext *ctx )
 {
    radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
    RADEON_FIREVERTICES( rmesa );
    LOCK_HARDWARE( rmesa );
    radeonWaitForIdleLocked( rmesa );
index 5bffade..112b902 100644 (file)
@@ -56,8 +56,7 @@
 
 /* 16 bit, RGB565 color spanline and pixel functions
  */
-#define GET_SRC_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y);
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
 #define SPANTMP_PIXEL_FMT GL_RGB
 #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
 
@@ -68,8 +67,7 @@
 
 /* 32 bit, ARGB8888 color spanline and pixel functions
  */
-#define GET_SRC_PTR(_x, _y) (buf + (_x) * 4 + (_y) * pitch)
-#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y);
+#define GET_PTR(_x, _y) (buf + (_x) * 4 + (_y) * pitch)
 #define SPANTMP_PIXEL_FMT GL_BGRA
 #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV