summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-16 11:48:18 -0700
committerBrian Paul <[email protected]>2012-01-24 14:12:24 -0700
commit1e1b5cb01a10e39d01923e3c7e989c44210950cd (patch)
tree6ed5e6042194c7126c5ebfcb8f30b1738c54d4b6 /src
parent82846fea4d042466ccfd5b3c86d98e856086cc05 (diff)
mesa: remove gl_renderbuffer:RowStride field
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_span.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_span.c2
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c3
-rw-r--r--src/mesa/main/mtypes.h5
-rw-r--r--src/mesa/swrast/s_drawpix.c2
-rw-r--r--src/mesa/swrast/s_renderbuffer.c5
-rw-r--r--src/mesa/swrast/s_texrender.c1
-rw-r--r--src/mesa/swrast/s_texture.c1
9 files changed, 7 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index d3c29244ddf..bd4fc7f589d 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -135,7 +135,7 @@ intel_map_renderbuffer(struct gl_context *ctx,
if (!irb && rb->Data) {
/* this is a malloc'd renderbuffer (accum buffer) */
GLint bpp = _mesa_get_format_bytes(rb->Format);
- GLint rowStride = rb->RowStride * bpp;
+ GLint rowStride = rb->RowStrideBytes;
*out_map = (GLubyte *) rb->Data + y * rowStride + x * bpp;
*out_stride = rowStride;
return;
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index d6b4d0f1c85..34bcd28f9a2 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -133,7 +133,6 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb)
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
&map, &stride);
rb->Map = map;
- rb->RowStride = stride / _mesa_get_format_bytes(rb->Format);
rb->RowStrideBytes = stride;
}
@@ -158,7 +157,6 @@ intel_renderbuffer_unmap(struct intel_context *intel,
ctx->Driver.UnmapRenderbuffer(ctx, rb);
rb->Map = NULL;
- rb->RowStride = 0;
rb->RowStrideBytes = 0;
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c
index be5a91340fa..6588ae82494 100644
--- a/src/mesa/drivers/dri/radeon/radeon_span.c
+++ b/src/mesa/drivers/dri/radeon/radeon_span.c
@@ -65,7 +65,6 @@ radeon_renderbuffer_map(struct gl_context *ctx, struct gl_renderbuffer *rb)
&map, &stride);
rb->Map = map;
- rb->RowStride = stride / _mesa_get_format_bytes(rb->Format);
rb->RowStrideBytes = stride;
}
@@ -79,7 +78,6 @@ radeon_renderbuffer_unmap(struct gl_context *ctx, struct gl_renderbuffer *rb)
ctx->Driver.UnmapRenderbuffer(ctx, rb);
rb->Map = NULL;
- rb->RowStride = 0;
rb->RowStrideBytes = 0;
}
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index e7f121ecf7c..efc55272508 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -292,7 +292,6 @@ swrast_alloc_front_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
rb->Data = NULL;
rb->Width = width;
rb->Height = height;
- rb->RowStride = width;
xrb->pitch = bytes_per_line(width * xrb->bpp, 32);
return GL_TRUE;
@@ -387,7 +386,7 @@ swrast_map_renderbuffer(struct gl_context *ctx,
struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
GLubyte *map = rb->Data;
int cpp = _mesa_get_format_bytes(rb->Format);
- int stride = rb->RowStride * cpp;
+ int stride = rb->Width * cpp;
if (rb->AllocStorage == swrast_alloc_front_storage) {
__DRIdrawable *dPriv = xrb->dPriv;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 093b0e4d467..22bcfa30e2d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2558,10 +2558,9 @@ struct gl_renderbuffer
GL_STENCIL_INDEX. */
gl_format Format; /**< The actual renderbuffer memory format */
- /* XXX the following 3 fields are obsolete and wil go away */
- GLint RowStride; /**< Padded width in units of pixels */
- GLenum DataType; /**< Type of values passed to the Get/Put functions */
+ /* XXX the following fields are obsolete and wil go away */
GLvoid *Data; /**< This may not be used by some kinds of RBs */
+ GLenum DataType; /**< Type of values passed to the Get/Put functions */
/** The following fields are only valid while the buffer is mapped */
GLubyte *Map;
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 5828a789ab9..5050ad92c23 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -522,7 +522,7 @@ fast_draw_depth_stencil(struct gl_context *ctx, GLint x, GLint y,
srcRowStride = _mesa_image_row_stride(unpack, width, format, type);
dst = _swrast_pixel_address(rb, x, y);
- dstRowStride = rb->RowStride * 4;
+ dstRowStride = rb->RowStrideBytes;
for (i = 0; i < height; i++) {
_mesa_pack_uint_24_8_depth_stencil_row(rb->Format, width,
diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c
index 267ec3b1501..2ef3e030cc2 100644
--- a/src/mesa/swrast/s_renderbuffer.c
+++ b/src/mesa/swrast/s_renderbuffer.c
@@ -214,7 +214,7 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
rb->Data = NULL;
}
- rb->RowStride = width;
+ rb->RowStrideBytes = width * _mesa_get_format_bytes(rb->Format);
if (width > 0 && height > 0) {
/* allocate new buffer storage */
@@ -223,7 +223,6 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
if (rb->Data == NULL) {
rb->Width = 0;
rb->Height = 0;
- rb->RowStride = 0;
_mesa_error(ctx, GL_OUT_OF_MEMORY,
"software renderbuffer allocation (%d x %d x %d)",
width, height, _mesa_get_format_bytes(rb->Format));
@@ -263,7 +262,7 @@ _swrast_map_soft_renderbuffer(struct gl_context *ctx,
{
GLubyte *map = rb->Data;
int cpp = _mesa_get_format_bytes(rb->Format);
- int stride = rb->RowStride * cpp;
+ int stride = rb->Width * cpp;
ASSERT(rb->Data);
diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c
index 1adf281fbd5..4a944310376 100644
--- a/src/mesa/swrast/s_texrender.c
+++ b/src/mesa/swrast/s_texrender.c
@@ -127,7 +127,6 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
trb->Base.Width = trb->TexImage->Base.Width;
trb->Base.Height = trb->TexImage->Base.Height;
- trb->Base.RowStride = trb->TexImage->RowStride;
trb->Base.InternalFormat = trb->TexImage->Base.InternalFormat;
trb->Base.Format = trb->TexImage->Base.TexFormat;
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index b98195e7489..0453640c0df 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -374,7 +374,6 @@ unmap_attachment(struct gl_context *ctx,
}
rb->Map = NULL;
- rb->RowStrideBytes = 0;
}