mesa: remove gl_renderbuffer:RowStride field

(cherry picked from commit 1e1b5cb01a)
This commit is contained in:
Brian Paul 2012-01-16 11:48:18 -07:00 committed by Ian Romanick
parent d60bcbe31d
commit f5367c4503
9 changed files with 7 additions and 16 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -2539,10 +2539,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;

View file

@ -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,

View file

@ -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);

View file

@ -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;

View file

@ -374,7 +374,6 @@ unmap_attachment(struct gl_context *ctx,
}
rb->Map = NULL;
rb->RowStrideBytes = 0;
}