void xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi) { struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi); boolean ret; ret = xmesa_st_framebuffer_display(stfbi, ST_ATTACHMENT_BACK_LEFT); if (ret) { struct pipe_resource **front, **back, *tmp; front = &xstfb->textures[ST_ATTACHMENT_FRONT_LEFT]; back = &xstfb->textures[ST_ATTACHMENT_BACK_LEFT]; /* swap textures only if the front texture has been allocated */ if (*front) { 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) xmesa_check_buffer_size(xstfb->buffer); } }
/** * Query the current drawable size and notify the binding context. */ void xmesa_check_buffer_size(XMesaBuffer b) { if (b->type == PBUFFER) return; xmesa_get_window_size(b->xm_visual->display, b, &b->width, &b->height); xmesa_notify_invalid_buffer(b); }
/** * Query the current drawable size and notify the binding context. */ void xmesa_check_buffer_size(XMesaBuffer b) { GLuint old_width, old_height; if (b->type == PBUFFER) return; old_width = b->width; old_height = b->height; xmesa_get_window_size(b->xm_visual->display, b, &b->width, &b->height); if (b->width != old_width || b->height != old_height) xmesa_notify_invalid_buffer(b); }