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;
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;
}
ctx->Driver.UnmapRenderbuffer(ctx, rb);
rb->Map = NULL;
- rb->RowStride = 0;
rb->RowStrideBytes = 0;
}
&map, &stride);
rb->Map = map;
- rb->RowStride = stride / _mesa_get_format_bytes(rb->Format);
rb->RowStrideBytes = stride;
}
ctx->Driver.UnmapRenderbuffer(ctx, rb);
rb->Map = NULL;
- rb->RowStride = 0;
rb->RowStrideBytes = 0;
}
rb->Data = NULL;
rb->Width = width;
rb->Height = height;
- rb->RowStride = width;
xrb->pitch = bytes_per_line(width * xrb->bpp, 32);
return GL_TRUE;
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;
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;
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,
rb->Data = NULL;
}
- rb->RowStride = width;
+ rb->RowStrideBytes = width * _mesa_get_format_bytes(rb->Format);
if (width > 0 && height > 0) {
/* allocate new buffer storage */
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));
{
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);
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;
}
rb->Map = NULL;
- rb->RowStrideBytes = 0;
}