diff options
author | Brian Paul <[email protected]> | 2012-01-16 12:10:46 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-24 14:12:26 -0700 |
commit | 7a36345f70a0b8ac2d480bb52eb2c74c2be5a978 (patch) | |
tree | 9c2208246754d4f5f9310a261c653e45933b1c4e /src/mesa/swrast | |
parent | f6a3979a0444a14c198c10501e9ff13f24625443 (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')
-rw-r--r-- | src/mesa/swrast/s_renderbuffer.c | 23 | ||||
-rw-r--r-- | src/mesa/swrast/s_texrender.c | 4 |
2 files changed, 15 insertions, 12 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; diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c index 368fa98b214..af4be7bab1c 100644 --- a/src/mesa/swrast/s_texrender.c +++ b/src/mesa/swrast/s_texrender.c @@ -135,12 +135,12 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) */ if (att->Texture->Target == GL_TEXTURE_3D || att->Texture->Target == GL_TEXTURE_2D_ARRAY_EXT) { - trb->Base.Data = trb->TexImage->Buffer + + trb->Base.Buffer = trb->TexImage->Buffer + trb->TexImage->ImageOffsets[trb->Zoffset] * _mesa_get_format_bytes(trb->TexImage->Base.TexFormat); } else { - trb->Base.Data = trb->TexImage->Buffer; + trb->Base.Buffer = trb->TexImage->Buffer; } /* XXX may need more special cases here */ |