1 /* $XFree86: xc/lib/GL/mesa/src/drv/common/stenciltmp.h,v 1.3 2001/03/21 16:14:20 dawes Exp $ */
8 #define HW_WRITE_LOCK() HW_LOCK()
10 #ifndef HW_WRITE_UNLOCK
11 #define HW_WRITE_UNLOCK() HW_UNLOCK()
15 #define HW_READ_LOCK() HW_LOCK()
17 #ifndef HW_READ_UNLOCK
18 #define HW_READ_UNLOCK() HW_UNLOCK()
21 static void TAG(WriteStencilSpan
)( GLcontext
*ctx
,
22 GLuint n
, GLint x
, GLint y
,
23 const GLstencil
*stencil
,
24 const GLubyte mask
[] )
37 CLIPSPAN(x
,y
,n
,x1
,n1
,i
);
39 if (DBG
) fprintf(stderr
, "WriteStencilSpan %d..%d (x1 %d)\n",
40 (int)i
, (int)n1
, (int)x1
);
46 WRITE_STENCIL( x1
, y
, stencil
[i
] );
51 WRITE_STENCIL( x1
, y
, stencil
[i
] );
60 static void TAG(WriteStencilPixels
)( GLcontext
*ctx
,
64 const GLstencil stencil
[],
65 const GLubyte mask
[] )
72 if (DBG
) fprintf(stderr
, "WriteStencilPixels\n");
79 const int fy
= Y_FLIP(y
[i
]);
80 if (CLIPPIXEL(x
[i
],fy
))
81 WRITE_STENCIL( x
[i
], fy
, stencil
[i
] );
91 /* Read stencil spans and pixels
93 static void TAG(ReadStencilSpan
)( GLcontext
*ctx
,
94 GLuint n
, GLint x
, GLint y
,
104 if (DBG
) fprintf(stderr
, "ReadStencilSpan\n");
109 CLIPSPAN(x
,y
,n
,x1
,n1
,i
);
111 READ_STENCIL( stencil
[i
], (x1
+i
), y
);
118 static void TAG(ReadStencilPixels
)( GLcontext
*ctx
, GLuint n
,
119 const GLint x
[], const GLint y
[],
120 GLstencil stencil
[] )
127 if (DBG
) fprintf(stderr
, "ReadStencilPixels\n");
132 int fy
= Y_FLIP( y
[i
] );
133 if (CLIPPIXEL( x
[i
], fy
))
134 READ_STENCIL( stencil
[i
], x
[i
], fy
);