st/xlib: Notify the context when the front/back buffers are swapped.

The current context should be notified when the the front/back buffers
of the current drawable are swapped.  The notification was skipped when
xmesa_strict_invalidate is false (the default).

This fixes fdo bug #29774.
This commit is contained in:
Chia-I Wu
2010-09-08 00:30:27 +08:00
parent 9ca59b2427
commit 03224f492d
3 changed files with 21 additions and 4 deletions
+14 -4
View File
@@ -1086,20 +1086,30 @@ XMesaDestroyBuffer(XMesaBuffer b)
}
/**
* Notify the binding context to validate the buffer.
*/
void
xmesa_notify_invalid_buffer(XMesaBuffer b)
{
XMesaContext xmctx = XMesaGetCurrentContext();
if (xmctx && xmctx->xm_buffer == b)
xmctx->st->notify_invalid_framebuffer(xmctx->st, b->stfb);
}
/**
* Query the current drawable size and notify the binding context.
*/
void
xmesa_check_buffer_size(XMesaBuffer b)
{
XMesaContext xmctx = XMesaGetCurrentContext();
if (b->type == PBUFFER)
return;
xmesa_get_window_size(b->xm_visual->display, b, &b->width, &b->height);
if (xmctx && xmctx->xm_buffer == b)
xmctx->st->notify_invalid_framebuffer(xmctx->st, b->stfb);
xmesa_notify_invalid_buffer(b);
}
@@ -360,6 +360,9 @@ extern void
xmesa_get_window_size(Display *dpy, XMesaBuffer b,
GLuint *width, GLuint *height);
extern void
xmesa_notify_invalid_buffer(XMesaBuffer b);
extern void
xmesa_check_buffer_size(XMesaBuffer b);
@@ -339,6 +339,10 @@ xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi)
tmp = *front;
*front = *back;
*back = tmp;
/* the current context should validate the buffer after swapping */
if (!xmesa_strict_invalidate)
xmesa_notify_invalid_buffer(xstfb->buffer);
}
if (xmesa_strict_invalidate)