summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/savage/savagespan.c
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger@gmx.ch>2005-07-01 00:08:46 +0000
committerRoland Scheidegger <rscheidegger@gmx.ch>2005-07-01 00:08:46 +0000
commitcf5b2f7419b28cdd533c60e205d5a90d96e85c8e (patch)
treec9e0fe4db16d0a4fdbe2b7f0711203770be23a75 /src/mesa/drivers/dri/savage/savagespan.c
parentc212abf99af494f024b0b981a83350f7ac9821ef (diff)
remove common macros used in the span functions of most drivers from the individual drivers and put them in common code. It is still possible for a driver to define its own macros if it has special needs. This affects CLIPPIXEL, CLIPSPAN, HW_CLIPLOOP, HW_ENDCLIPLOOP, and for drivers using the spantmp2 template also GET_SRC_PTR and GET_DST_PTR.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savagespan.c')
-rw-r--r--src/mesa/drivers/dri/savage/savagespan.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c
index fef0aeec78..a261299cc5 100644
--- a/src/mesa/drivers/dri/savage/savagespan.c
+++ b/src/mesa/drivers/dri/savage/savagespan.c
@@ -42,6 +42,7 @@
GLubyte *buf = map + \
dPriv->x * cpp + \
dPriv->y * pitch; \
+ char *read_buf = buf; \
GLuint p; \
(void) p
@@ -58,20 +59,6 @@
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
- _y >= miny && _y < maxy)
-
-
-#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
- if ( _y < miny || _y >= maxy ) { \
- _n1 = 0, _x1 = x; \
- } else { \
- _n1 = _n; \
- _x1 = _x; \
- if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
- if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
- }
-
#define Y_FLIP(_y) (height - _y - 1)
#define HW_LOCK()
@@ -86,26 +73,9 @@
savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
GLubyte *map = imesa->readMap;
-#define HW_CLIPLOOP() \
- do { \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
- int _nc = dPriv->numClipRects; \
- while (_nc--) { \
- int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
- int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
- int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
- int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
-
-
-#define HW_ENDCLIPLOOP() \
- } \
- } while (0)
-
/* 16 bit, 565 rgb color spanline and pixel functions
*/
-#define GET_SRC_PTR(_x, _y) (buf + (_x<<1) + _y*pitch)
-#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y)
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
@@ -116,8 +86,6 @@
/* 32 bit, 8888 ARGB 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 SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
@@ -148,7 +116,6 @@
-
/* 16 bit float depthbuffer functions
*/
#define WRITE_DEPTH( _x, _y, d ) \
@@ -166,7 +133,6 @@
-
/* 8-bit stencil /24-bit integer depth depthbuffer functions.
* Depth range is reversed. See also savageCalcViewport.
*/
@@ -186,7 +152,6 @@
-
/* 24 bit float depthbuffer functions
*/
#define WRITE_DEPTH( _x, _y, d ) do { \