wlroots/include
Simon Ser abf527b075 render/gles2: fix texture cleanup on destroy
When importing a DMA-BUF wlr_buffer as a wlr_texture, the GLES2
renderer caches the result, in case the buffer is used for texturing
again in the future. When the wlr_texture is destroyed by the caller,
the wlr_buffer is unref'ed, but the wlr_gles2_texture is kept around.
This is fine because wlr_gles2_texture listens for wlr_buffer's destroy
event to avoid any use-after-free.

However, with this logic wlr_texture_destroy doesn't "really" destroy
the wlr_gles2_texture. It just decrements the wlr_buffer ref'count.
Each wlr_texture_destroy call must have a matching prior
wlr_texture_create_from_buffer call or the ref'counting will go south.

Wehn destroying the renderer, we don't want to decrement any wlr_buffer
ref'count. Instead, we want to go through any cached wlr_gles2_texture
and destroy our GL state. So instead of calling wlr_texture_destroy, we
need to call our internal gles2_texture_destroy function.

Closes: https://github.com/swaywm/wlroots/issues/2941
2021-05-30 10:11:09 -04:00
..
backend backend/x11: use common renderer and allocator 2021-05-21 22:13:54 +02:00
render render/gles2: fix texture cleanup on destroy 2021-05-30 10:11:09 -04:00
types types/wlr_buffer: introduce wlr_buffer_cap 2021-04-28 20:55:57 +02:00
util util/uuid: replace with util/token, remove libuuid 2021-04-11 19:09:36 +02:00
wlr backend: automatically create allocator 2021-05-21 22:13:54 +02:00
xcursor xcursor: make cursor data and metadata const 2021-02-05 10:04:20 +01:00
xwayland xwayland: query window PIDs via XResQueryClientIds 2021-04-23 09:55:01 +02:00
meson.build render: make GLES2 renderer optional 2021-04-17 16:39:40 +02:00