diff options
author | Brian Paul <brianp@vmware.com> | 2009-11-16 14:46:38 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-11-16 14:46:38 -0700 |
commit | fa919f16e7e0e154d46d80cef967ce6c4ea88084 (patch) | |
tree | 800c397448839cb344197a9b3d8f1fd15e912a0c | |
parent | 40897fc6db295cff60ba062d370dfaf7690e60c7 (diff) |
mesa: remove unneeded tests around ctx->Driver.FreeTexImageData() calls
-rw-r--r-- | src/mesa/main/mipmap.c | 3 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 35 |
2 files changed, 9 insertions, 29 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 61d3d56e8a..b609061c6e 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1605,8 +1605,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, } /* Free old image data */ - if (dstImage->Map.Data) - ctx->Driver.FreeTexImageData(ctx, dstImage); + ctx->Driver.FreeTexImageData(ctx, dstImage); /* initialize new image */ _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 763e122445..1647efc2b2 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2137,9 +2137,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } + ctx->Driver.FreeTexImageData( ctx, texImage ); ASSERT(texImage->Map.Data == NULL); @@ -2258,9 +2256,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } + ctx->Driver.FreeTexImageData( ctx, texImage ); ASSERT(texImage->Map.Data == NULL); clear_teximage_fields(texImage); /* not really needed, but helpful */ @@ -2374,9 +2370,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } + ctx->Driver.FreeTexImageData( ctx, texImage ); ASSERT(texImage->Map.Data == NULL); clear_teximage_fields(texImage); /* not really needed, but helpful */ @@ -2684,9 +2678,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } + ctx->Driver.FreeTexImageData( ctx, texImage ); ASSERT(texImage->Map.Data == NULL); @@ -2764,9 +2756,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } + ctx->Driver.FreeTexImageData( ctx, texImage ); ASSERT(texImage->Map.Data == NULL); @@ -3292,10 +3282,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Map.Data == NULL); + ctx->Driver.FreeTexImageData( ctx, texImage ); _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, border, internalFormat); @@ -3402,10 +3389,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Map.Data == NULL); + ctx->Driver.FreeTexImageData( ctx, texImage ); _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, border, internalFormat); @@ -3510,10 +3494,7 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D"); } else { - if (texImage->Map.Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Map.Data == NULL); + ctx->Driver.FreeTexImageData( ctx, texImage ); _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, |