From c4f44c07c6662d1ce08603945ccc4fa5afaa742a Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 27 Feb 2012 07:24:18 +0100 Subject: fontconfig pixman mesa git update 27 Feb 2012 --- mesalib/src/mesa/swrast/s_context.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'mesalib/src/mesa/swrast/s_context.c') diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c index cc304d70c..63350b2e7 100644 --- a/mesalib/src/mesa/swrast/s_context.c +++ b/mesalib/src/mesa/swrast/s_context.c @@ -726,6 +726,18 @@ _swrast_CreateContext( struct gl_context *ctx ) const GLuint maxThreads = 1; #endif + assert(ctx->Const.MaxViewportWidth <= SWRAST_MAX_WIDTH); + assert(ctx->Const.MaxViewportHeight <= SWRAST_MAX_WIDTH); + + assert(ctx->Const.MaxRenderbufferSize <= SWRAST_MAX_WIDTH); + + /* make sure largest texture image is <= SWRAST_MAX_WIDTH in size */ + assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= SWRAST_MAX_WIDTH); + assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= SWRAST_MAX_WIDTH); + assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= SWRAST_MAX_WIDTH); + + assert(PROG_MAX_WIDTH == SWRAST_MAX_WIDTH); + if (SWRAST_DEBUG) { _mesa_debug(ctx, "_swrast_CreateContext\n"); } @@ -790,6 +802,19 @@ _swrast_CreateContext( struct gl_context *ctx ) ctx->swrast_context = swrast; + swrast->stencil_temp.buf1 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte)); + swrast->stencil_temp.buf2 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte)); + swrast->stencil_temp.buf3 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte)); + swrast->stencil_temp.buf4 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte)); + + if (!swrast->stencil_temp.buf1 || + !swrast->stencil_temp.buf2 || + !swrast->stencil_temp.buf3 || + !swrast->stencil_temp.buf4) { + _swrast_DestroyContext(ctx); + return GL_FALSE; + } + return GL_TRUE; } @@ -806,6 +831,12 @@ _swrast_DestroyContext( struct gl_context *ctx ) if (swrast->ZoomedArrays) FREE( swrast->ZoomedArrays ); FREE( swrast->TexelBuffer ); + + free(swrast->stencil_temp.buf1); + free(swrast->stencil_temp.buf2); + free(swrast->stencil_temp.buf3); + free(swrast->stencil_temp.buf4); + FREE( swrast ); ctx->swrast_context = 0; -- cgit v1.2.3