[gtk] gl renderer: Mark pointer textures as used
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl renderer: Mark pointer textures as used
- Date: Wed, 6 Mar 2019 08:04:26 +0000 (UTC)
commit eeed55d45c2a3b6ece15f44427515664483d310e
Author: Timm Bäder <mail baedert org>
Date: Tue Mar 5 09:00:55 2019 +0100
gl renderer: Mark pointer textures as used
Otherwise we remove them, causing additional texture uploads.
gsk/gl/gskgldriver.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/gsk/gl/gskgldriver.c b/gsk/gl/gskgldriver.c
index c88b93b52a..ebc3e21349 100644
--- a/gsk/gl/gskgldriver.c
+++ b/gsk/gl/gskgldriver.c
@@ -547,6 +547,25 @@ gsk_gl_driver_get_texture_for_pointer (GskGLDriver *self,
id = GPOINTER_TO_INT (g_hash_table_lookup (self->pointer_textures, pointer));
+ if (id != 0)
+ {
+ GHashTableIter iter;
+ gpointer value_p;
+ /* Find the texture in self->textures and mark it used */
+
+ g_hash_table_iter_init (&iter, self->textures);
+ while (g_hash_table_iter_next (&iter, NULL, &value_p))
+ {
+ Texture *t = value_p;
+
+ if (t->texture_id == id)
+ {
+ t->in_use = TRUE;
+ break;
+ }
+ }
+ }
+
return id;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]