From 3f856c6b6b7fa95ef97a8712876de88d7d57932e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 17 Jun 2009 08:35:55 -0600 Subject: mesa: rework viewport/scissor initialization code The first time a context is bound to a drawable, the viewport and scissor bounds are initialized to the buffer's size. This is actually a bit tricky. A new _mesa_check_init_viewport() function is called in several places to check if the viewport has been initialized. We also use a new ctx->ViewportInitialized flag instead of the overloaded ctx->FirstTimeCurrent flag. --- src/mesa/state_tracker/st_framebuffer.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/mesa/state_tracker/st_framebuffer.c') diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 331575660d..33a90ea7db 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -134,16 +134,7 @@ void st_resize_framebuffer( struct st_framebuffer *stfb, if (stfb->Base.Width != width || stfb->Base.Height != height) { GET_CURRENT_CONTEXT(ctx); if (ctx) { - if (stfb->InitWidth == 0 && stfb->InitHeight == 0) { - /* didn't have a valid size until now */ - stfb->InitWidth = width; - stfb->InitHeight = height; - if (ctx->Viewport.Width <= 1) { - /* set context's initial viewport/scissor size */ - _mesa_set_viewport(ctx, 0, 0, width, height); - _mesa_set_scissor(ctx, 0, 0, width, height); - } - } + _mesa_check_init_viewport(ctx, width, height); _mesa_resize_framebuffer(ctx, &stfb->Base, width, height); -- cgit v1.2.3