swrast: Reuse _swrast_free_texture_image_buffer from drivers.
authorEric Anholt <eric@anholt.net>
Fri, 19 Apr 2013 18:57:28 +0000 (11:57 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 30 Apr 2013 17:40:43 +0000 (10:40 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/radeon/radeon_texture.c

index 2fbd5c4e81527e4b38c6001805a97a30812a09bd..24f13dfee8993933345666fb0f0847223594978d 100644 (file)
@@ -121,13 +121,7 @@ intel_free_texture_image_buffer(struct gl_context * ctx,
 
    intel_miptree_release(&intelImage->mt);
 
-   if (intelImage->base.Buffer) {
-      _mesa_align_free(intelImage->base.Buffer);
-      intelImage->base.Buffer = NULL;
-   }
-
-   free(intelImage->base.ImageOffsets);
-   intelImage->base.ImageOffsets = NULL;
+   _swrast_free_texture_image_buffer(ctx, texImage);
 }
 
 /**
index a953858d3bb51a2b80524827366ac7f6fdf2c701..23942cbb0a05827c9c41bdbfecc9a4ab6f7c5b3e 100644 (file)
@@ -127,20 +127,13 @@ void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_imag
 
        if (image->mt) {
                radeon_miptree_unreference(&image->mt);
-       } else {
-               _swrast_free_texture_image_buffer(ctx, timage);
        }
        if (image->bo) {
                radeon_bo_unref(image->bo);
                image->bo = NULL;
        }
-       if (image->base.Buffer) {
-               _mesa_align_free(image->base.Buffer);
-               image->base.Buffer = NULL;
-       }
 
-       free(image->base.ImageOffsets);
-       image->base.ImageOffsets = NULL;
+        _swrast_free_texture_image_buffer(ctx, timage);
 }
 
 /**