From 5fb4fb602bde5140dcea45464e3b70a49078ad2e Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 24 Feb 2012 08:16:00 +0100 Subject: fontconfig libX11 pixman xserver git update 24 Feb 2012 --- mesalib/src/mesa/swrast/s_texture.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'mesalib/src/mesa/swrast/s_texture.c') diff --git a/mesalib/src/mesa/swrast/s_texture.c b/mesalib/src/mesa/swrast/s_texture.c index 72d309300..9718367a8 100644 --- a/mesalib/src/mesa/swrast/s_texture.c +++ b/mesalib/src/mesa/swrast/s_texture.c @@ -96,6 +96,25 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx, swImg->ImageOffsets[i] = i * width * height; } + _swrast_init_texture_image(texImage, width, height, depth); + + return GL_TRUE; +} + + +/** + * Code that overrides ctx->Driver.AllocTextureImageBuffer may use this to + * initialize the fields of swrast_texture_image without allocating the image + * buffer or initializing ImageOffsets or RowStride. + * + * Returns GL_TRUE on success, GL_FALSE on memory allocation failure. + */ +void +_swrast_init_texture_image(struct gl_texture_image *texImage, GLsizei width, + GLsizei height, GLsizei depth) +{ + struct swrast_texture_image *swImg = swrast_texture_image(texImage); + if ((width == 1 || _mesa_is_pow_two(texImage->Width2)) && (height == 1 || _mesa_is_pow_two(texImage->Height2)) && (depth == 1 || _mesa_is_pow_two(texImage->Depth2))) @@ -115,8 +134,6 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx, swImg->HeightScale = (GLfloat) texImage->Height; swImg->DepthScale = (GLfloat) texImage->Depth; } - - return GL_TRUE; } -- cgit v1.2.3