[gtk/wip/chergert/glproto: 414/493] use single glDeleteTextures() call when freeing pool
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 414/493] use single glDeleteTextures() call when freeing pool
- Date: Fri, 19 Feb 2021 02:25:20 +0000 (UTC)
commit 277264ac47458fca7660f38a8f960771a0fb26a9
Author: Christian Hergert <chergert redhat com>
Date: Mon Feb 8 14:04:12 2021 -0800
use single glDeleteTextures() call when freeing pool
gsk/next/gskgltexturepool.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gsk/next/gskgltexturepool.c b/gsk/next/gskgltexturepool.c
index 198cb963c8..6c8b26669b 100644
--- a/gsk/next/gskgltexturepool.c
+++ b/gsk/next/gskgltexturepool.c
@@ -68,6 +68,9 @@ gsk_gl_texture_pool_init (GskGLTexturePool *self)
void
gsk_gl_texture_pool_clear (GskGLTexturePool *self)
{
+ guint *texture_ids = g_newa (guint, self->by_width.length);
+ guint i = 0;
+
while (self->by_width.length > 0)
{
GskGLTexture *head = g_queue_peek_head (&self->by_width);
@@ -75,11 +78,17 @@ gsk_gl_texture_pool_clear (GskGLTexturePool *self)
g_queue_unlink (&self->by_width, &head->width_link);
g_queue_unlink (&self->by_height, &head->height_link);
+ texture_ids[i++] = head->texture_id;
+ head->texture_id = 0;
+
gsk_gl_texture_free (head);
}
g_assert (self->by_width.length == 0);
g_assert (self->by_height.length == 0);
+
+ if (i > 0)
+ glDeleteTextures (i, texture_ids);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]