diff options
author | Keith Packard <keithp@keithp.com> | 2013-11-21 21:30:07 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2013-12-20 16:17:59 -0800 |
commit | 95b04850d0c578392288939723d8d56e4b600c93 (patch) | |
tree | c207ab904cd3a15f4495c0f75886acdcec0f8fbe /src/glx/dri3_priv.h | |
parent | 568a27588d13146d0fd7cb4e775e1ac0187e5e29 (diff) | |
download | external_mesa3d-95b04850d0c578392288939723d8d56e4b600c93.zip external_mesa3d-95b04850d0c578392288939723d8d56e4b600c93.tar.gz external_mesa3d-95b04850d0c578392288939723d8d56e4b600c93.tar.bz2 |
dri3: Free resources when drawable is destroyed.
Always nice to clean up after ourselves.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glx/dri3_priv.h')
-rw-r--r-- | src/glx/dri3_priv.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h index efdc2ae..eb81ce7 100644 --- a/src/glx/dri3_priv.h +++ b/src/glx/dri3_priv.h @@ -89,6 +89,7 @@ struct dri3_buffer { uint32_t sync_fence; /* XID of X SyncFence object */ struct xshmfence *shm_fence; /* pointer to xshmfence object */ GLboolean busy; /* Set on swap, cleared on IdleNotify */ + GLboolean own_pixmap; /* We allocated the pixmap ID, free on destroy */ void *driverPrivate; uint32_t size; @@ -171,6 +172,8 @@ dri3_pixmap_buf_id(enum dri3_buffer_type buffer_type) return DRI3_FRONT_ID; } +#define DRI3_NUM_BUFFERS (1 + DRI3_MAX_BACK) + struct dri3_drawable { __GLXDRIdrawable base; __DRIdrawable *driDrawable; @@ -194,7 +197,7 @@ struct dri3_drawable { uint64_t previous_time; unsigned frames; - struct dri3_buffer *buffers[1 + DRI3_MAX_BACK]; + struct dri3_buffer *buffers[DRI3_NUM_BUFFERS]; int cur_back; int depth; |