summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_renderbuffer.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-16 12:10:46 -0700
committerBrian Paul <[email protected]>2012-01-24 14:12:26 -0700
commit7a36345f70a0b8ac2d480bb52eb2c74c2be5a978 (patch)
tree9c2208246754d4f5f9310a261c653e45933b1c4e /src/mesa/swrast/s_renderbuffer.c
parentf6a3979a0444a14c198c10501e9ff13f24625443 (diff)
mesa: rename gl_renderbuffer::Data to Buffer
To better indicate that this pointer to the malloc'd memory.
Diffstat (limited to 'src/mesa/swrast/s_renderbuffer.c')
-rw-r--r--src/mesa/swrast/s_renderbuffer.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c
index 825214c95df..52697f2ac75 100644
--- a/src/mesa/swrast/s_renderbuffer.c
+++ b/src/mesa/swrast/s_renderbuffer.c
@@ -113,18 +113,18 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
}
/* free old buffer storage */
- if (rb->Data) {
- free(rb->Data);
- rb->Data = NULL;
+ if (rb->Buffer) {
+ free(rb->Buffer);
+ rb->Buffer = NULL;
}
rb->RowStrideBytes = width * _mesa_get_format_bytes(rb->Format);
if (width > 0 && height > 0) {
/* allocate new buffer storage */
- rb->Data = malloc(width * height * _mesa_get_format_bytes(rb->Format));
+ rb->Buffer = malloc(width * height * _mesa_get_format_bytes(rb->Format));
- if (rb->Data == NULL) {
+ if (rb->Buffer == NULL) {
rb->Width = 0;
rb->Height = 0;
_mesa_error(ctx, GL_OUT_OF_MEMORY,
@@ -162,9 +162,9 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
static void
soft_renderbuffer_delete(struct gl_renderbuffer *rb)
{
- if (rb->Data) {
- free(rb->Data);
- rb->Data = NULL;
+ if (rb->Buffer) {
+ free(rb->Buffer);
+ rb->Buffer = NULL;
}
free(rb);
}
@@ -178,11 +178,14 @@ _swrast_map_soft_renderbuffer(struct gl_context *ctx,
GLubyte **out_map,
GLint *out_stride)
{
- GLubyte *map = rb->Data;
+ GLubyte *map = rb->Buffer;
int cpp = _mesa_get_format_bytes(rb->Format);
int stride = rb->Width * cpp;
- ASSERT(rb->Data);
+ if (!map) {
+ *out_map = NULL;
+ *out_stride = 0;
+ }
map += y * stride;
map += x * cpp;