From: Chia-I Wu Date: Mon, 18 Jan 2010 04:05:25 +0000 (+0800) Subject: st/vega: Fix window resizing with egl_g3d. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ed63119452396e764a0f5b11db78903a2594df1;p=mesa.git st/vega: Fix window resizing with egl_g3d. egl_g3d calls st_set_framebuffer_surface on window resize. It updates the renderbuffer's geometry and makes st_resize_framebuffer a no-op. This commit improves the no-op check a little bit. It can do better after gallium-fb-dimensions is merged. --- diff --git a/src/gallium/state_trackers/vega/vg_context.h b/src/gallium/state_trackers/vega/vg_context.h index ff8c1a04217..bc88c8d139d 100644 --- a/src/gallium/state_trackers/vega/vg_context.h +++ b/src/gallium/state_trackers/vega/vg_context.h @@ -50,7 +50,7 @@ struct st_renderbuffer { }; struct st_framebuffer { - VGint init_width, init_height; + VGint width, height; struct st_renderbuffer *strb; struct st_renderbuffer *dsrb; diff --git a/src/gallium/state_trackers/vega/vg_tracker.c b/src/gallium/state_trackers/vega/vg_tracker.c index ff80aab03a3..617c174eb6a 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.c +++ b/src/gallium/state_trackers/vega/vg_tracker.c @@ -193,8 +193,8 @@ struct st_framebuffer * st_create_framebuffer(const void *visual, */ stfb->alpha_mask = 0; - stfb->init_width = width; - stfb->init_height = height; + stfb->width = width; + stfb->height = height; stfb->privateData = privateData; } @@ -282,11 +282,14 @@ void st_resize_framebuffer(struct st_framebuffer *stfb, /* If this is a noop, exit early and don't do the clear, etc below. */ - if (strb->width == width && - strb->height == height && + if (stfb->width == width && + stfb->height == height && state->zsbuf) return; + stfb->width = width; + stfb->height = height; + if (strb->width != width || strb->height != height) st_renderbuffer_alloc_storage(ctx, strb, width, height);