summaryrefslogtreecommitdiff
path: root/src/mesa/main/drawpix.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-09-26 20:53:53 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-09-26 20:53:53 +0000
commitb1394fa92aaaf859ce9efc8b5fc194397921320c (patch)
tree48612380d5f16b24deacf643e127fc1b319fbc18 /src/mesa/main/drawpix.c
parent3b18a36f210da9d66acd1228d24948cd77c2e81e (diff)
First batch of OpenGL SI related changes:
Renamed struct gl_context to struct __GLcontextRec. Include glcore.h, setup GL imports/exports. Replaced gl_ prefix with _mesa_ prefix in context.[ch] functions. GLcontext's Visual field is no longer a pointer.
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r--src/mesa/main/drawpix.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index bfc4a59aa4..52e27fe5da 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.34 2000/09/12 21:09:24 brianp Exp $ */
+/* $Id: drawpix.c,v 1.35 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -202,7 +202,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else {
/* setup array of fragment Z value to pass to zoom function */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
GLint i;
ASSERT(drawWidth < MAX_WIDTH);
for (i=0; i<drawWidth; i++)
@@ -222,7 +222,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
*/
if (format==GL_RGBA && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels) * 4;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -259,7 +259,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
return GL_TRUE;
}
else if (format==GL_RGB && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels) * 3;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -295,7 +295,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
return GL_TRUE;
}
else if (format==GL_LUMINANCE && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels);
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -353,7 +353,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
return GL_TRUE;
}
else if (format==GL_LUMINANCE_ALPHA && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels)*2;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -418,7 +418,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) {
GLubyte *src = (GLubyte *) pixels + skipRows * rowLength + skipPixels;
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
/* convert CI data to RGBA */
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
/* no zooming */
@@ -510,7 +510,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
- GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF);
+ GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
GLint i;
for (i = 0; i < drawWidth; i++) {
zspan[i] = zval;
@@ -620,7 +620,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
/* Colors or indexes */
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0F);
GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0F);
GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0F);
@@ -641,7 +641,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort)
- && !bias_or_scale && !zoom && ctx->Visual->RGBAflag) {
+ && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
/* Special case: directly write 16-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
@@ -654,8 +654,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP );
}
}
- else if (type==GL_UNSIGNED_INT && ctx->Visual->DepthBits == 32
- && !bias_or_scale && !zoom && ctx->Visual->RGBAflag) {
+ else if (type==GL_UNSIGNED_INT && ctx->Visual.DepthBits == 32
+ && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
/* Special case: directly write 32-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
@@ -673,7 +673,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
_mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src,
&ctx->Unpack, ctx->ImageTransferState );
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
if (zoom) {
gl_write_zoomed_rgba_span(ctx, width, x, y, zspan,
(const GLubyte (*)[4])rgba, desty);
@@ -725,7 +725,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
GLint i;
for (i=0;i<width;i++) {
zspan[i] = z;
@@ -892,7 +892,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
draw_depth_pixels( ctx, x, y, width, height, type, pixels );
break;
case GL_COLOR_INDEX:
- if (ctx->Visual->RGBAflag)
+ if (ctx->Visual.RGBAflag)
draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels);
else
draw_index_pixels(ctx, x, y, width, height, type, pixels);