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); } }
void xmesa_copy_st_framebuffer(struct st_framebuffer_iface *stfbi, enum st_attachment_type src, enum st_attachment_type dst, int x, int y, int w, int h) { xmesa_st_framebuffer_copy_textures(stfbi, src, dst, x, y, w, h); if (dst == ST_ATTACHMENT_FRONT_LEFT) xmesa_st_framebuffer_display(stfbi, dst); }
/** * Called via st_framebuffer_iface::flush_front() */ static boolean xmesa_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi, enum st_attachment_type statt) { struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi); boolean ret; ret = xmesa_st_framebuffer_display(stfbi, statt); if (ret && xmesa_strict_invalidate) xmesa_check_buffer_size(xstfb->buffer); return ret; }