st/dri: Only create new textures if drawable has changed

This commit is contained in:
Jakob Bornecrantz 2009-05-18 02:50:15 +01:00
parent d0639d067e
commit 7d11a392d7
2 changed files with 17 additions and 0 deletions

View file

@ -138,6 +138,18 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv)
dri_drawable->pBackClipRects[0].x2 = dri_drawable->w;
dri_drawable->pBackClipRects[0].y2 = dri_drawable->h;
if (drawable->old_num == count &&
drawable->old_w == dri_drawable->w &&
drawable->old_h == dri_drawable->h &&
memcmp(drawable->old, buffers, sizeof(__DRIbuffer) * count) == 0) {
return;
} else {
drawable->old_num = count;
drawable->old_w = dri_drawable->w;
drawable->old_h = dri_drawable->h;
memcpy(drawable->old, buffers, sizeof(__DRIbuffer) * count);
}
for (i = 0; i < count; i++) {
enum pipe_format format = 0;
int index = 0;

View file

@ -46,6 +46,11 @@ struct dri_drawable
unsigned attachments[8];
unsigned num_attachments;
__DRIbuffer old[8];
unsigned old_num;
unsigned old_w;
unsigned old_h;
/* gallium */
struct st_framebuffer *stfb;
struct pipe_fence_handle *swap_fences[DRI_SWAP_FENCES_MAX];